|
-
Sep 23rd, 2000, 11:57 AM
#1
Thread Starter
New Member
If I have a multiselectable listbox...
How do you programmatically/runtime, highlight an
item in a listbox??? (could be more than one thats why I allowed multiselect)
Cheers
-
Sep 23rd, 2000, 12:04 PM
#2
Code:
List1.Selected(2) = True
List1.Selected(5) = True
List1.Selected(8) = True
-
Sep 23rd, 2000, 12:12 PM
#3
Thread Starter
New Member
Doesnt that force a List_Click call????
I dont want that....
-
Sep 23rd, 2000, 12:25 PM
#4
Frenzied Member
Why don't you want that? got code in the List1_Click event?
Then just use a boolean to tell the Event it's passed by code!
Code:
Private ByCode As Boolean
Private Sub HighLight()
'Tell it it's called by code
ByCode = True
'Highlight the items
List1.Selected(2) = True
List1.Selected(5) = True
List1.Selected(8) = True
'End telling it's by code
ByCode = False
End Sub
Private Sub List1_Click()
'If it's called by code don't do anything!
If Bycode = True Then Exit Sub
'... rest of your code here
End Sub
Jop - validweb.nl
Alcohol doesn't solve any problems, but then again, neither does milk.
-
Sep 23rd, 2000, 12:27 PM
#5
Thread Starter
New Member
Yeah Ive got that but I was wondering if there was a better/neater way of doing it...
Thanks anyway!
-
Sep 23rd, 2000, 12:31 PM
#6
Frenzied Member
Yeah there's probably is a complicated API way, but this works.
Maybe http://www.mvps.org/vbnet/ has some API ways, but I don't know if it's worth the surfing
Jop - validweb.nl
Alcohol doesn't solve any problems, but then again, neither does milk.
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
|