Assembly: System (in system.dll)
/** @property */ public ISynchronizeInvoke get_SynchronizingObject () /** @property */ public void set_SynchronizingObject (ISynchronizeInvoke value)
public function get SynchronizingObject () : ISynchronizeInvoke public function set SynchronizingObject (value : ISynchronizeInvoke)
Property ValueThe ISynchronizeInvoke representing the object used to marshal the event-handler calls that are issued when an interval has elapsed. The default is a null reference (Nothing in Visual Basic).
When SynchronizingObject is a null reference (Nothing in Visual Basic), the method that handles the Elapsed event is called on a thread from the system-thread pool. For more information on system-thread pools, see ThreadPool.
When the Elapsed event is handled by a visual Windows Forms component, such as a button, accessing the component through the system-thread pool might result in an exception or just might not work. Avoid this effect by setting SynchronizingObject to a Windows Forms component, which causes the method that handles the Elapsed event to be called on the same thread that the component was created on.
If the Timer is used inside Visual Studio in a Windows Forms designer, SynchronizingObject is automatically set to the control that contains the Timer. For example, if you place a Timer on a designer for Form1 (which inherits from Form), the SynchronizingObject property of Timer is set to the instance of Form1.
Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter EditionThe Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.