기타 [VB.NET] program that uses WithEvents, Handles
페이지 정보
본문
Module Module1
' An instance of the Event class.
WithEvents EventClassInstance As New EventClass
Sub PrintTestMessage() Handles EventClassInstance.TestEvent
' This method handles the TestEvent.
Console.WriteLine("Test Message Being Printed...")
End Sub
Sub PrintTestMessage2() Handles EventClassInstance.TestEvent
' This method also handles the event.
Console.WriteLine("Test Message 2 Being Printed...")
End Sub
Sub Main()
' Call into the Event class and raise the test events.
EventClassInstance.RaiseEvents()
End Sub
Class EventClass
Public Event TestEvent()
Sub RaiseEvents()
' Raise the Test event.
' ... This needs to be part of the class with the Event.
RaiseEvent TestEvent()
End Sub
End Class
End Module
- 이전글[VB.NET] Sort Examples: Arrays and Lists - Dot Net Perls 21.03.18
- 다음글[vb.net] JSON 기본 정리 21.02.08
댓글목록
등록된 댓글이 없습니다.