checkedlist box problem - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

checkedlist box problem

havejeethavejeet Posts: 17Member
Hi all,

I have two problems
1. I have a comma separated string values. I want to load them all into checkedlistbox as items.....HOW?

2. how do I get the itemindex of checkedlistbox, passing the text?

regards and thanks


  • PsightoplazmPsightoplazm Posts: 332Member ✭✭
    You can't treat a string byref in .NET unfortunately. The only thing you can do is create a class that holds a string and override the ToString() method.

    Here is how you retrieve an item's index.
    var me = new CheckedListBox();
    var s = "This is a string";
    var index = me.Items.Add(s); // you can retrieve when adding
    var altIndex = me.Items.IndexOf(s); // or after the fact.

  • havejeethavejeet Posts: 17Member
    Hi friends,

    it was as simple as it looks!

    arrFieldList = new ArrayList(strAllFields.Split(new char[] { ',' }));

    for (int i = 0; i < arrFieldList.Count; i++)

Sign In or Register to comment.