Jul 11, 2012

14. Drop down list

Public Class Form1

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

        With ComboBox1.Items
            .Add("CPU")
            .Add("RAM")
            .Add("Motherboard")
            .Add("Hard Disk")
            .Add("DVD Drive")
            .Add("Monitor")
            .Add("Keyboard")
            .Add("Mouse")
            .Add("Cabinet")
        End With

    End Sub

    Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
        TextBox1.Text &= ComboBox1.SelectedItem & vbCrLf
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Label3.Text = "Thank you"
    End Sub
End Class



No comments:

Post a Comment