Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I am new to programming and was hoping for a little direction.

I am trying to code my combo box that I have created, anybody have any samples that I could look at? For example if they select an item, I want it to use this code, if they select the next item I want it to use this code etc.

 

Thank you and sorry if this is too remedial for anyone.

  • Moderators
Posted

try this out...

   Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, _
                                       ByVal e As System.EventArgs) _
                                       Handles ComboBox1.SelectedIndexChanged

       Select Case ComboBox1.Text.ToString
           Case "test 1"
               'Do something
           Case "test 2"
               'Do something
           Case "test 3"
               'Do something
       End Select
   End Sub

   Private Sub form1_Load(ByVal sender As System.Object, _
                               ByVal e As System.EventArgs) Handles MyBase.Load


       ComboBox1.Items.Add("test 1")
       ComboBox1.Items.Add("test 2")
       ComboBox1.Items.Add("test 3")
   End Sub

Visit...Bassic Software

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...