Results 1 to 5 of 5

Thread: [RESOLVED]ComboBox - stupid problem

Threaded View

  1. #4
    Smitten by reality Harsh Gupta's Avatar
    Join Date
    Feb 2005
    Posts
    2,938

    Re: ComboBox - stupid problem

    try this:
    VB Code:
    1. Private Sub Command1_Click()
    2.     Dim i%
    3.  
    4.     For i = (Combo1.ListCount) To 1 Step -1
    5.         Combo1.RemoveItem (i - 1)
    6.     Next i
    7. End Sub
    backward loop because, when you delete 1 item, the list gets organised automatically. i.e. if you delete 3rd element, then the 4th one becomes 3rd, 5th becomes 4th and so on.

    Harsh Gupta
    Last edited by Harsh Gupta; Feb 26th, 2006 at 11:33 AM.
    Show Appreciation. Rate Posts.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width