Solved

disable highlighting of listbox selection

Posted on 2004-09-03
3
469 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 250 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

RIA (Rich Internet Application) tools are interactive internet applications which have many of the characteristics of desktop applications. The RIA tools typically deliver output either by the way of a site-specific browser or via browser plug-in. T…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

920 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

15 Experts available now in Live!

Get 1:1 Help Now