Skip to Content
1
Former Member
Jul 18, 2007 at 01:28 PM

Problems with the System.Windows.Forms.Timer

613 Views

Hi All,

Could some one help me please? I'm having a problem using the System.Windows.Forms.Timer inside an ItemEvent, the timer event just doesn't works...give a look in my code:

private System.Windows.Forms.Timer myTimer = new System.Windows.Forms.Timer();

.

.

.

if (pVal.FormUID.Equals("FrmTimer") && pVal.ItemUID.Equals("btnStartTimer") && (pVal.Before_Action.Equals(true)) && (pVal.EventType.Equals(SAPbouiCOM.BoEventTypes.et_CLICK)))

{

myTimer .Interval = 1000;

myTimer .Enabled = true;

myTimer .Tick += new EventHandler(myTimer _Tick);

}

void myTimer _Tick(object sender, EventArgs e)

{

SBO_Application.MessageBox("Timer: " + DateTime.Now, 1, "OK", "", "");

}

does someone have already tried to use the timer inside an itemevent, or could suggest another solution?

thanks a lot...