Solved checking items in 2 checkedlistboxes

Microsoft Visual studio 2008 professiona...
January 18, 2011 at 12:32:35
Specs: Windows 7, 4ghz
I have two checkedlistboxs and I want to check an item in one checklistbox which will check the corresponding item in the ohter checklistbox. If I uncheck that item it will do the same in the other checkedlistbox.

See More: checking items in 2 checkedlistboxes

Report •

May 26, 2011 at 01:31:53
✔ Best Answer
Assuming you are using VB to achieve this, what you could do is match the index values of each checkbox item, use a control array for each checkbox catagory, for example

ChkBoxA(0) = "German"
ChkBoxA(1) = "Dead"
ChkBoxA(2) = "Mouse"
ChkBoxA(3) = "Cheese"

ChkBoxB(0) = "Shepard"
ChkBoxB(1) = "Cat"
ChkBoxB(2) = "Tasey"
ChkBoxB(3) = "Burger"

so now what you can do is, under the click event of ChkBoxA you can say, if chkBoxA(3) = checked then ChkBoxB(3) = checked.

Hope you understand what i mean, if not then i can provide some code for the above,

Report •
Related Solutions

Ask Question