G
Guest
Hi, All,
I want user select first item (called All) in listbox, then all other items
are selected by SetSelected method, but in loop (see code below) whenever
going to SetSelected(), the SelectedIndexChanged event keep fire and loop
doesn't go to next, finally the program stop at infinite loop.
Sub lstCem_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles lstCem.SelectedIndexChanged
If lstCem.GetSelected(0) = True Then
For i = 1 To (lstCem.Items.Count - 1)
lstCem.SetSelected(i, True)
Next
end if
End Sub
can anyone help thisout?
Thanks,
Marin
I want user select first item (called All) in listbox, then all other items
are selected by SetSelected method, but in loop (see code below) whenever
going to SetSelected(), the SelectedIndexChanged event keep fire and loop
doesn't go to next, finally the program stop at infinite loop.
Sub lstCem_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles lstCem.SelectedIndexChanged
If lstCem.GetSelected(0) = True Then
For i = 1 To (lstCem.Items.Count - 1)
lstCem.SetSelected(i, True)
Next
end if
End Sub
can anyone help thisout?
Thanks,
Marin