home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic .NET - Read Less - Learn More
/
Visual_Basic.NET_Read_Less_Learn_More_Richard_Bowman_Visual_2002.iso
/
Resources
/
Code
/
Ch7-UsingYourClass
/
Module1.vb
< prev
Wrap
Text File
|
2001-09-23
|
870b
|
31 lines
Class SampleClass
Private mProperty1 As String
Public Function Method1(ByVal val As Integer) As String
RaiseEvent Event1(val)
Return "Sample return value from calling Method1"
End Function
Public Property Property1() As String
Get
Return mProperty1
End Get
Set(ByVal Value As String)
mProperty1 = Value
End Set
End Property
Public Event Event1(ByVal Value As Integer)
End Class
Module Module1
Dim WithEvents myObject As New SampleClass()
Sub Main()
Console.WriteLine(myObject.Method1(10))
myObject.Property1 = "Value"
Console.ReadLine()
End Sub
Public Sub myObject_Event1(ByVal Value As Integer) Handles myObject.Event1
Console.WriteLine("The event returned: " & Value)
End Sub
End Module