stu nicholls dot com | menu - Professional dropdown #3



What is Classes?
Creating Classes And Structure
Public Class Add
class member implementation
End Class
Public Structure Add
structure member implementation
End Class
Adding Member
Public Class Add
Public a As Integer
End Class
Nested Types Program
Public Class Form1
Public Class Test
Public Structure ValueTest
Public t1 As Integer
End Structure
Public Class RefTest
Public t2 As Integer
End Class
Public Sub CreateTypes()
Dim TestStructure As ValueTest
TestStructure = New ValueTest()
TestStructure.t1 = 21
MessageBox.Show(TestStructure.t1, "Testing structure")
Dim TestClass As RefTest
TestClass = New RefTest()
TestClass.t2 = 51
MessageBox.Show(TestClass.t2, "Testing Class")
End Sub
End Class
Private Sub Button1_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles Button1.Click
Dim ob1 As New Test()
ob1.CreateTypes()
End Sub
End Class


Classes Vs Structure

Next>>


comments powered by Disqus
Footer1