[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

disable highlighting of listbox selection

Posted on 2004-09-03
3
Medium Priority
?
481 Views
Last Modified: 2008-02-01
I have a group of listboxes that a user selects items from. Normally you select an item from a listbox and the item becomes highlighted blue, click it again and the highlighting is disabled. Is it possible to disable the highlighting, or as the item is selected remove the highlighting.
Also when a user holds down the spacebar in a listbox,all consecutive items are selected, can this be prevented.
0
Comment
Question by:dearness
  • 2
3 Comments
 

Accepted Solution

by:
vb6wizard earned 1000 total points
ID: 11975736
I am not entirely sure what programming language you are using but I will answer it from the Visual Basic point of view.  You want to immediately disable the highlighting of an item as soon as it is selected.  The code that I am putting below will do this in Visual Basic.  A few things to note -- the name of the object is List1 so you will need to change this to the name of the object that you are using.  This code is also placed in the Click Method.  I will post some more details later.
Private Sub List1_Click()
  If List1.ListIndex >= 0 Then
      If List1.Selected(List1.ListIndex) = True Then
          List1.Selected(List1.ListIndex) = False
      End If
  End If
End Sub
0
 

Author Comment

by:dearness
ID: 11978855
vbWizard,
sorry for not giving the programming language, but you were right on target. Your suggestion works great. Nice simple answer.
Thanks.
0
 

Author Comment

by:dearness
ID: 11978858
By the way, I had one of the list boxes set for multi select, thats why the spacebar was selecting consecutive items
0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

Question has a verified solution.

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

Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
The SignAloud Glove is capable of translating American Sign Language signs into text and audio.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

825 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