ComboBox

gomindi

Freshman
Joined
Aug 28, 2002
Messages
25
Location
UT
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.
 
try this out...
Visual Basic:
    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
 
Back
Top