Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How to lock a list box...

Posted on 2004-07-31
3
Medium Priority
?
189 Views
Last Modified: 2012-05-05
I have a list box on a VB form.  I don't want to disable it (because I want its content to stay dark and readable).  Also, don't like it to be selectable (now, when I click on a item on this list box, it gets selected and that item gets high-lighted).

Following doesn't work?

Sub lstBox_MouseUp(....)
   lstBox.Selected = False
End Sub
----------
I also made txtDummy, and
Sub lstBox_Click()
   txtDummy.SetFocus
End Sub

Sub txtDummy_GotFocus()
   lstBox.Selected = False
End Sub

Any Idea?
0
Comment
Question by:Mike Eghtebas
  • 2
3 Comments
 
LVL 67

Accepted Solution

by:
sirbounty earned 1000 total points
ID: 11686732
Try:

Private Sub List1_Click()
List1.ListIndex = -1
End Sub
0
 
LVL 34

Author Comment

by:Mike Eghtebas
ID: 11686747
Thank you Sir.

Mike
0
 
LVL 67

Expert Comment

by:sirbounty
ID: 11686751
Happy to help. : )
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

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

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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 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…
Suggested Courses

877 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