Constructs an EventHandler for the specified method on the given control instance.
Syntax
Parameters
- control
- handler
Example
Library/Library.Test/TestDelegates.cs
C# | Copy Code |
---|
EventHandler<VerifiedReceiptEventArgs> handler;
VerifiedReceiptEventArgs args = new VerifiedReceiptEventArgs();
_thread.Start();
_form.FormCreated.WaitOne();
try
{
handler = new EventHandlerForControl<VerifiedReceiptEventArgs>(_form, CloseTheForm);
handler(null, args);
}
finally
{
_thread.Join();
} |
VB.NET | Copy Code |
---|
Dim handler As EventHandler(Of VerifiedReceiptEventArgs)
Dim args As New VerifiedReceiptEventArgs()
_thread.Start()
_form.FormCreated.WaitOne()
Try
handler = New EventHandlerForControl(Of VerifiedReceiptEventArgs)(_form, CloseTheForm)
handler(Nothing, args)
Finally
_thread.Join()
End Try |
Requirements
Target Platforms: Windows XP, Windows Server 2003, Windows Vista, Windows Server 2008, Windows 7
See Also