hinge
February 5th, 2003, 02:33 PM
Task:
I have a listview with checkboxes. The idear is that the only one item in the listview can be checked at one time. So when the user clicks on a new item the all other items should be unchecked (the other item).
My solution:
in the listview1_ItemCheck event I put code to uncheck the old item, ei:
Olditem.checked = CheckState.Unchecked
Problem:
this line of code
Olditem.checked = CheckState.Unchecked
makes the listview1_ItemCheck event fire again and thus causing an endless loop.....
Somebody.............Please help, this is not how it was in VB6...I know that some of you hate the remark.
I have a listview with checkboxes. The idear is that the only one item in the listview can be checked at one time. So when the user clicks on a new item the all other items should be unchecked (the other item).
My solution:
in the listview1_ItemCheck event I put code to uncheck the old item, ei:
Olditem.checked = CheckState.Unchecked
Problem:
this line of code
Olditem.checked = CheckState.Unchecked
makes the listview1_ItemCheck event fire again and thus causing an endless loop.....
Somebody.............Please help, this is not how it was in VB6...I know that some of you hate the remark.