Solved

How to lock a list box...

Posted on 2004-07-31
3
184 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 250 total points
Comment Utility
Try:

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

Author Comment

by:Mike Eghtebas
Comment Utility
Thank you Sir.

Mike
0
 
LVL 67

Expert Comment

by:sirbounty
Comment Utility
Happy to help. : )
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

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…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

763 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

6 Experts available now in Live!

Get 1:1 Help Now