Class Exercise: Class List
We will make a program that allows the user to display and search several different class lists.
- Begin by designing the form.
- Use the names
lstStudents, lblCount, cmdFirstGrade, cmdSecondGrade, txtFind, cmdFind, cmdDone
for the controls on the form. - Add code to
cmdDone
. - Add a global array variable named
strStudents()
. - Add code to
cmdFirstGrade
andcmdSecondGrade
to redimension the array and set the names of the students. Finally, call a subroutine namedDisplayList
. - Create a subroutine named
DisplayList
that uses a For…Next loop to display the names of the students in the array. - Add code to
cmdFind
that searches the currently displayed class list for any whole or partial matches (not case sensitive).
Class List Code |
' global variables Dim strStudents() As String Private Sub cmdDone_Click() Private Sub cmdFirstGrade_Click() Private Sub cmdSecondGrade_Click() Sub DisplayList() ‘ dimension Private Sub cmdFind_Click() |