Control.BeginInvoke Method (Delegate)

Executes the specified delegate asynchronously on the thread that the control's underlying handle was created on.

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in

Public Function BeginInvoke ( _
	method As Delegate _
) As IAsyncResult
Dim instance As Control
Dim method As Delegate
Dim returnValue As IAsyncResult

returnValue = instance.BeginInvoke(method)
public IAsyncResult BeginInvoke (
	Delegate method
public function BeginInvoke (
	method : Delegate
) : IAsyncResult



A delegate to a method that takes no parameters.

Return Value

An IAsyncResult that represents the result of the BeginInvoke operation.

The delegate is called asynchronously, and this method returns immediately. You can call this method from any thread, even the thread that owns the control's handle. If the control's handle does not exist yet, this method searches up the control's parent chain until it finds a control or form that does have a window handle. If no appropriate handle can be found, BeginInvoke will throw an exception. Exceptions within the delegate method are considered untrapped and will be sent to the application's untrapped exception handler.


Most methods on a control can only be called from the thread where the control was created. In addition to the InvokeRequired property, there are four methods on a control that are thread safe: Invoke, BeginInvoke, EndInvoke, and CreateGraphics. For all other method calls, you should use one of the invoke methods to marshal the call to the control's thread. The invoke methods always invoke their callbacks on the control's thread.


An exception might be thrown if the thread that should process the message is no longer active.

The following code example demonstrates a use of the BeginInvoke method.

Delegate Sub InvokeDelegate()

Private Sub Invoke_Click(sender As Object, e As EventArgs)
   myTextBox.BeginInvoke(New InvokeDelegate(AddressOf InvokeMethod))
End Sub 'Invoke_Click

Public Sub InvokeMethod()
   myTextBox.Text = "Executed the given delegate"
End Sub 'InvokeMethod

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0, 1.1, 1.0

.NET Compact Framework

Supported in: 2.0