Library tutorials & articles

Combo Box

Properties and Events

A combo box has the following main properties:

Property

Changes...

Name

Control Reference

Text

Default Text displayed

List

Items on the dropdown list

Style

the combo style (see above)

Sorted

whether the combo box is automatically sorted (read-only at runtime)

The ComboBox control has the following main events:

Event

Occurs When...

Click()

The ComboBox is clicked

DblClick()

The ComboBox is double clicked

Change()

The selected item changes

GotFocus()

The ComboBox is selected

Comments

  1. 13 Apr 2007 at 00:09

    Try this:

    ComboBox1.Items.Add("Text")

    It's pretty flexible, you can put just about anything in there:

    ComboBox1.Items.Add("Text" & RichTextBox1.Text & someVariable & etc.)

     

    - Vincent

     

  2. 07 Mar 2004 at 04:41

    The .AddItem is to add items to the Combo Box at run time. This is normally the preferred way of doing this instead of doing it through the properties of the Combo Box.


    Usage:
    Combo1.AddItem "String"

  3. 11 Apr 2003 at 18:31

    Yeah, I was getting an error like "Invalid procedure call or argument" (Runtime error 5). It seems to work if I remove the index # (rather than Combo1.Additem "Blah" 2, just Combo1.Additem "Blah").

  4. 06 Aug 2002 at 12:43

    Combo1.AddItem tells me that it's a wrong code.

  5. 01 Jan 1999 at 00:00

    This thread is for discussions of Combo Box.

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