Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

ListBox : Highlight the first item

Posted on 2001-07-25
3
Medium Priority
?
287 Views
Last Modified: 2006-11-17
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
0
Comment
Question by:nguyenn
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 6

Accepted Solution

by:
JonFish85 earned 200 total points
ID: 6319398
try:

List1.Selected(0) = True
0
 
LVL 1

Author Comment

by:nguyenn
ID: 6319424
Thanks JonFish, it works

Have a nice day :)
0
 
LVL 6

Expert Comment

by:JonFish85
ID: 6319435
glad I could help!
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question