Solved

ListBox : Highlight the first item

Posted on 2001-07-25
3
271 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
  • 2
3 Comments
 
LVL 6

Accepted Solution

by:
JonFish85 earned 50 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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

708 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now