In a formProgramEncountered a problem, using a timer to operate the Form Control, did not respond in release, debug reported an error. An error occurred while calling non-internal controls. Data Query discovery must be non-thread-safe. invokerequired can be used to ensure thread security to prevent errors.
Controls in Windows Forms 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 one of the control's invoke methods to invoke al the call to the proper thread. this property can be used to determine if you must call an invoke method, which can be useful if you do not know what thread owns a control.
(When the form control is not thread-safe, it is bound to the specified thread. When you call it through other threads, you must use the call method of the control to configure the call for queuing. If you must call the invokerequired property of a method, you can use it to determine whether the control is available now .)
Public Delegate void mycallback ();
Public void myfunction ()
{< br> If (this. control name. invokerequired)
{< br> mycallback d = new mycallback (myfunction);
This. invoke (d);
}< br> else
{< br> // perform the operation
}< BR >}