how to remove all item from combo box

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • muddasirmunir
    Contributor
    • Jan 2007
    • 284

    how to remove all item from combo box

    i am using this code in load event of the form to add item to
    combo box

    Code:
     combobox1.additem "aaa" 
    combobox1.additem "bbb"
    now i want when i click a buttton all the items in the combo box are removed

    so what is the code to remove all the item in combbox
  • CyberSoftHari
    Recognized Expert Contributor
    • Sep 2007
    • 488

    #2
    You did not point what is your version.

    In VB 2005:
    [CODE=vb]comboBox1.Items .Clear()[/CODE]

    In VB 6.0
    [CODE=vb]'Not sure. Just check like below.
    comboBox1.Clear
    comboBox1.Remov e[/CODE]

    Comment

    • debasisdas
      Recognized Expert Expert
      • Dec 2006
      • 8119

      #3
      ComboBox1.Clear

      will do that for you.

      Comment

      Working...