|
|
Gets or sets a value indicating whether the PrinterMonitorComponent control monitors the job added event.
[Visual Basic] Public Property ThreadTimeout As Integer [C#] public int ThreadTimeout {get; set;} [C++] public: __property int get_ThreadTimeout(); public: __property void set_ThreadTimeout(int); [JScript] public function get ThreadTimeout() : integer; public function set ThreadTimeout(integer);
If set to -1 the polling thread will only return when a printer event occurs. Otherwise this value is the polling interval in milliseconds.
This should be set before the DeviceName is set.
[Visual Basic, C#] The following example creates a PrinterMonitorComponent control to monitor a printer named "Cannon BJC640". This example uses the ThreadTimeout to set the thread polling frequency to 1 second intervals to reduce the load on the system.
[Visual Basic] Private Sub CreateMyPrinterMonitorComponent() ' Create an instance of a PrinterMonitorComponent control. Dim PrinterMonitorComponent1 As New PrinterMonitorComponent() ' Ignore JobAdded Events PrinterMonitorComponent1.ThreadTimeout = 1000 ' Start monitoring the HP Laserjet 4 printer PrinterMonitorComponent1.DeviceName = "Cannon BJC640" End Sub [C#] private void CreateMyPrinterMonitorComponent() { // Create an instance of a PrinterMonitorComponent control. PrinterMonitorComponent PrinterMonitorComponent1 = new PrinterMonitorComponent(); //Ignore JobAdded Events PrinterMonitorComponent1.ThreadTimeout = 1000; // Start monitoring the HP Laserjet 4 printer PrinterMonitorComponent1.DeviceName = "Cannon BJC640"; }
[JScript C++] No example is available for JSCript or C++. To view a Visual Basic or C#, example, click the Language Filter button
in the upper-left corner of the page.
Platforms: Windows NT 4.0, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows .NET Server family
© 2003 Merrion Computing Ltd. All rights reserved.