CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2002
    Location
    United Kingdom
    Posts
    60

    Problem with ComboBox...

    Hi all,

    I have a Combo Box on my form called Combo1. I have added a number of items to the box using "AddItem". I want to be able to let the user only select an option from the box and not type in something in the space.

    Something like this (in a timer control):

    If Not Combo1.Text = "Option A" or Not Combo1.Text = "Option B" or Not Combo1.Text = "Option C" Then

    Msg = MsgBox("Only select an item from the box")

    End If

    This code does not work very well though, because if I select "Option A" for example it still produces the message box??

    Any Info

    Thanks,

    Mark

  2. #2
    Join Date
    Jun 2001
    Location
    MO, USA
    Posts
    2,868
    Just change it's Style property to DropDownList and get rid of all that timer code.

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

Featured