Solved

ListBox : Highlight the first item

Posted on 2001-07-25
3
277 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
VBA saving file message display 5 73
VBA filters 2 66
Access Object Property from VBA Module in Excel 2010 2 37
Add and format columns in vb6 7 63
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

830 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