Library tutorials & articles

ListBox Control

Properties and Events

The Listboxes main properties are explained below:

Property Changes...
Name Control Reference
Text Default Text displayed
List Items on the dropdown list
Style The listbox style (see above)
Sorted whether the listbox is automatically sorted (read-only at runtime)
Multiselect whether you can select more than one item at a time (must be set to False when Style = Checkbox)
Columns the number of columns the items are displayed in when they do not fit in the screen

The ListBox control has the following main events:

Event Occurs When...
Click() The ListBox is clicked
DblClick() The ListBox is double clicked
Change() The selected item changes
GotFocus() The ListBox is selected
ItemCheck() When an item is checked or unchecked

Comments

  1. 19 Mar 2007 at 07:33
    When i need right click selection for some list controls i'm just using ListView control instead of ListBox. Can't see any reason why to write any additional code. Simplicity must be kept in everything!

  2. 16 Jan 2006 at 06:01

    Suppose I have numeric values in my listbox. How do I add them and display the result on a message box.

  3. 30 Jul 2005 at 08:54
    How to lock particular item in the list box in visual basic?
  4. 01 Jan 1999 at 00:00

    This thread is for discussions of ListBox Control.

Leave a comment

Sign in or Join us (it's free).

James Crowley James first started this website when learning Visual Basic back in 1999 whilst studying his GCSEs. The site grew steadily over the years while being run as a hobby - to a regular monthly audience ...
AddThis

Related discussion

Related podcasts

  • Christian Beauclair

    14 mai 2008 (�mission #0074) ::.Christian Beauclair: Stratégies de migration VB6 vers .NET Nous discutons avec Christian Beauclair des stratégies de migration VB6 vers .NET. Entre autres, nous discutons comment utiliser le "VB 6 Code Advisor" et le "Interop Forms Toolkit" pour ajouter la puiss...

We'd love to hear what you think! Submit ideas or give us feedback