I have a kiosk app written with the .Net Compact Framework that captures barcode scans and sends them to a central server. The process is so fast that my "WAIT" notification never appears. There is no feedback to the user that a successful scan was submitted. I would like to use the Time class to pause the code for 2 seconds so the user is notified. I cannot get it to work properly. I know the Timer class in the Compact Framework lacks some of the methods that the full framework enjoys.
Here is my event assignment
this.timer1.Tick += new EventHandler(StatusTick);
Here is my code to use the timer
interval = Convert.ToInt32(x.ReadAppSetting("display_interval"));
this.timer1.Interval = interval;
this.timer1.Enabled = true;
while (exitFlag == false)
{
Application.DoEvents();
}
this.timer1.Enabled = false;
Here is my Tick event:
private void StatusTick(object sender, EventArgs e)
{
if (interval > 0)
{
changeStatusLabel("WAIT");
labelCardNumber.Text = readerData.Text;
interval = interval - 1000;
}
else
{
changeStatusLabel("READY");
labelCardNumber.Text = "";
exitFlag = true;
}
}
In the Compact Framework there don't seem to be Timer.Start() and Timer.Stop() methods.