Thursday, September 18, 2008

Visual Basic Coding

Public Class Form1

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim newStudent As New Student("joe", 2.3)
Label1.Text = newStudent.hey
End Sub
End Class


Public Class Student
Dim name As String
Dim gpa As Decimal

Public Sub New(ByVal name1 As String,ByVal gpa1 As Decimal)
'Intializes object from datarow
name = name1
gpa = gpa1
End Sub

Public Function hey() As Double
Return gpa
End Function

End Class

No comments: