kiosk touchscreen button click issue

G

Guest

Platform: Win CE 4.2 : touchscreen device
I am creating a kiosk app that allows user to navigate through a wizard to
perform one or more transactions. All of the navigation through the different
forms is done via click events on a System.Windows.Forms.Button derived
class. Everything seems to work fine when the user touches the buttons on the
touchscreen correctly (tapping the button only once). The problem I am
running into is that when the user touches the button multiple times or
presses down on the button too long multiple click events seem to get fired.
When this happens it seems that the following scenario is happening:
Let's say we have three forms that are to be displayed successively in the
wizard - form1, form2, form3. Each of these forms contains buttons and event
handlers to act on the button click event. If the user is on form1 and
presses the button to navigate to form2 incorrectly(touches it twice or holds
it down too long), it appears that form1's button click handler is called
which calls code to dispose of form1 and load form2. But before form2 is
finished getting loaded form2's button click event handler is fired which
calls code to dispose form2 and load form3.
My question is: Is there a way in code to prevent this sort of behavior from
occurring?

mark
 
D

Daniel Moth

Disable the button after it has been tapped on. Re-enable it only when it is
applicable again. Use busy cursors/progressbars to let your user know that
they have asked for an action and they should now wait until it has
finished.

Cheers
Daniel
 
G

Guest

Correction to original post:
the buttons are derived from System.Windows.Forms.Control.

I added code to disable the button in the event handler. This seems to solve
the problem where the user presses the button for too long a time. But there
still remains the problem of the person who touches the button multiple
times. In that case I am still seeing the same behavior where a button on the
next form is catching the event. In the debugger I can see that if on form1 I
double press a button its click event is fired and the next form, form2 is
loaded and a button that is located in a similar position on form2 as the
double pressed button on form1 cat ches a click event and then form3 is
loaded.
???

thanks -
mark
 
D

Daniel Moth

If you have tapped on a button and you get the feedback of a busy cursor
plus the button turning grey, you are not inclined to keep on tapping. Is
there something in your design of this control that invites the user to
double-click? Maybe you should change that. Otherwise, you can make sure the
button on the next form does not occupy the same space OR you can disable it
and enable it after 1 second OR you can just leave it as is and the users
will learn that one tap is enough.

Cheers
Daniel
 
G

Guest

I have added the following code to the button click event handler:

// Disable button to solve "double pressing" problem on touchscreen.
this.btnEnglish.Enabled = false;
// Wait Cursor
System.Windows.Forms.Cursor.Current =
System.Windows.Forms.Cursors.WaitCursor;

System.Windows.Forms.Cursor.Show();

But the problem of the user double pressing in rapid succession is still
there.
I am going to see if sleeping the thread on the succeeding form's
initialization helps....
Mark
 
G

Guest

It also seems that deleying the thread does not affect the behavior. I tried
delaying the thread from 1 - 5 seconds and the same behavior takes place.
Could it be the system or .NET CF runtime is caching click events?
At this point I don't know what else to try - I will have to create error
handling which takes the "double press" scenario into account.

Mark
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top