I have 2 list box ..
when I click on the first one , I want to unselect all the selected item in the second..
I try this code:
list1.selected = false
but vb make an error .. ( hhhhhaaaa! )
can anyone help ?
Printable View
I have 2 list box ..
when I click on the first one , I want to unselect all the selected item in the second..
I try this code:
list1.selected = false
but vb make an error .. ( hhhhhaaaa! )
can anyone help ?
Private Sub Command1_Click()
List1.Selected(List1.ListIndex) = False
End Sub
this command will unselect ALL the item in the list box ??
hum..
look :
I select and item in the first listbox..
I select and item in the second listbox..
The first list box unselect all the item ..
BUT I DONT WANT TO UNSELECT THE ITEM IN THE SECOND !!
I want to the item stay selected in the list box I work but not in the other one ..
Sorry but I can't get your point.
How could the item in the second get unselected when you select it???
more discribtion needed here.
look :
i select two item in the first listbox ....
after, i select one into the SECOND list box ..
the FIRST list box must UNSELECT all the selected items
and dont unselect the item into the SECOND list box..
understand ??
only one list box can have selected item at the same time ..
What is the problem then? you can use for...next loop to unselect all the items:
Private Sub List2_GotFocus()
For i = 0 to list1.Count - 1
list1.selected(i) = False
Next
End Sub
Private Sub List1_GotFocus()
For i = 0 to list2.Count - 1
list1.selected(i) = False
Next
End Sub
you dont understand..
it's not important..
I make another way to do what I want..
It's because I speak french and I can't explain
what I really want in english ..
thank's a lot ;0)
Understood!
Enjoy;) Also, try to understand it.Code:Private PubTex As String
Private Sub Form_Load()
PubTex = List2.Text
End Sub
Private Sub List2_Click()
Dim cy As Integer
cy = 0
If List2.Text <> PubTex Then
Do Until List1.ListCount < 0
cy = cy + 1
List1.Selected(cy) = False
Loop
End If
PubTex = List2.Text
End Sub
pro2: Quand est le question?
[Note: my french grammar and spelling is VERY bad. You can try Matthew Gates.] 'Il comprehend beaucoup français.'