Control.getInvokeRequired

Overview | Methods | Fields | This Package | All Packages

Control.getInvokeRequired

Determines whether the caller must call invoke when making method calls to this control.

Syntax

public final synchronized boolean getInvokeRequired()

Return Value

Returns true if the control's Win32 window handle is on a different thread from the calling thread, indicating that you should make calls to the control through the invoke method.

Remarks

Controls in WFC are bound to a specific thread and are not thread safe. Therefore, if you are calling a control's method from a different thread, you must use the control's invoke method to marshal the call to the proper thread. This function can be used to determine if you must call invoke, which can be useful if you don't know what thread owns a control.

There are four functions on a control that are safe to call from any thread: getInvokeRequired, invoke, invokeAsync, and createGraphics. For all other method calls, you should use one of the invokeXXX methods.

See Also   Control.invoke, Control.invokeAsync