Very new to vb and this is just a static example - no database.
I have a list box and based on the choice of the listbox I want to populate a combobox:
I have a list box and based on the choice of the listbox I want to populate a combobox:
VB.NET:
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
lstSubject.Items.Add("Introduction to Computers")
lstSubject.Items.Add("Beginning Programming")
lstSubject.Items.Add("Intermediate Programming")
lstSubject.Items.Add("System Analysis")
End Sub
Private Sub cboBooks_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cboBooks.SelectedIndexChanged
Dim strSelectedSubject As String
strSelectedSubject = " "
Select Case strSelectedSubject
Case "Introduction to Computers"
Case "Beginning Programming"
Case "Intermediate Programming"
Case "Intermediate Programming"
Case "System Analysis"
End Select
End Sub