|
-
Oct 7th, 2000, 09:39 PM
#1
Thread Starter
Addicted Member
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 ?
-
Oct 7th, 2000, 09:46 PM
#2
Lively Member
Private Sub Command1_Click()
List1.Selected(List1.ListIndex) = False
End Sub
Yesterday is history ... Tomorrow is mistry .. Today is a gift.
VB6 , intermidiat
-
Oct 7th, 2000, 09:55 PM
#3
Thread Starter
Addicted Member
this command will unselect ALL the item in the list box ??
-
Oct 7th, 2000, 09:59 PM
#4
Thread Starter
Addicted Member
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 ..
-
Oct 7th, 2000, 10:05 PM
#5
Lively Member
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.
Yesterday is history ... Tomorrow is mistry .. Today is a gift.
VB6 , intermidiat
-
Oct 7th, 2000, 10:08 PM
#6
Thread Starter
Addicted Member
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 ..
-
Oct 7th, 2000, 10:24 PM
#7
Lively Member
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
Yesterday is history ... Tomorrow is mistry .. Today is a gift.
VB6 , intermidiat
-
Oct 7th, 2000, 10:25 PM
#8
Thread Starter
Addicted Member
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)
-
Oct 7th, 2000, 10:26 PM
#9
Understood!
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
Enjoy Also, try to understand it.
-
Oct 7th, 2000, 10:32 PM
#10
pro2: Quand est le question?
[Note: my french grammar and spelling is VERY bad. You can try Matthew Gates.] 'Il comprehend beaucoup français.'
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|