Saturday, September 20, 2008

Code

Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim name As String = nameOfStudent.Text
'add the ability to read in the gpa from the user!!!
Dim gpa1 As Decimal = gpa.Text
Dim newStudent As New Student(name, gpa1)
'using the name entered by the user in the constructor!!
studentName.Text = newStudent.getName
gpaLbl.Text = newStudent.getGPA

End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
'first we will get the school name from the user!!!
Dim schoolName As String = txtSchoolName.Text
'now we need to write out the school name TO the user!!!
displayName.Text = schoolName
End Sub
End Class

No comments: