Page 1 of 1

c# EventHandler

Posted: 22 May 2020, 15:20
by vuser
Hello guys,

I'm maybe missing something with EventHandler on Ventuz ?

Here is an example of code i try, but TimerState didn't wait interval to change.
(same problem with using System.Windows.Timers instead of Forms)

Code: Select all

	System.Windows.Forms.Timer Timer1 = new System.Windows.Forms.Timer();
	bool TimerState;
	
	private void TimerEventProcessor(Object sender, EventArgs myEventArgs)
	{
		TimerState = false;
	}
	public bool OnMethod2(int arg)
	{
		Timer1.Interval = 3000;
		Timer1.Enabled = true;
		Timer1.Tick += new EventHandler(TimerEventProcessor);
		TimerState = true;
		return false;
	}

Re: c# EventHandler

Posted: 25 May 2020, 09:11
by sribas
no problem with this code, don't forget to use and add assembly
Windows.System.Forms;