ListBox : Highlight the first item

I have a ListBox has some items. To enable get multi selection, I set property MultiSelect = 2 (Extended) at design time. At run time, after loading my ListBox, I set default to the first item:

If (List1.ListCount > 0) Then
   List1.ListIndex = 0
End If

But the above command doesnt highlight to the first record (If I set property MultiSelect = 0 (None), it hightlights)

Thanks in advance

nguyenn
LVL 1
nguyennAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
JonFish85Connect With a Mentor Commented:
try:

List1.Selected(0) = True
0
 
nguyennAuthor Commented:
Thanks JonFish, it works

Have a nice day :)
0
 
JonFish85Commented:
glad I could help!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.