Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How to lock a list box...

Posted on 2004-07-31
3
Medium Priority
?
188 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
[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 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying 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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
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…
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

730 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