Solved

How to lock a list box...

Posted on 2004-07-31
3
186 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 250 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: 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

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…
I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
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…
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…

733 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