The following example demonstrates
|
|
theTimer = dotNetObject
"System.Windows.Forms.Timer" --create a
Timer fn printTime = (print localTime) --define a MAXScript function to be called by the Timer. dotnet.addEventHandler theTimer "tick" printTime --add ON TICK event hander to call the function theTimer.interval = 1000 --set the tick interval to 1 second (1000 milliseconds) theTimer.start() --start the Timer --theTimer.stop() --use this method to stop the Timer. |
RESULT: |
dotNetObject:System.Windows.Forms.Timer printTime() OK 1000 undefined "10/20/2006 1:11:28 PM" "10/20/2006 1:11:29 PM" "10/20/2006 1:11:30 PM" "10/20/2006 1:11:31 PM" ... |
DotNet Classes Used: |
dotNetObject:System.Windows.Forms.Timer |
Last Modified: 2006/10/20