tap and hold event

S

Salazaar

Hi,

I am trying to create a custom control using the .net framework sdk. I want
a context menu to popup when the control is clicked. Right now, the context
menu pops up only when the user taps and holds the stylus for a while. How
do I make this happend when the control is clicked instead of tapped and
held?

Any ideas?

Regards
 
H

Herfried K. Wagner [MVP]

* "Salazaar said:
I am trying to create a custom control using the .net framework sdk. I want
a context menu to popup when the control is clicked. Right now, the context
menu pops up only when the user taps and holds the stylus for a while. How
do I make this happend when the control is clicked instead of tapped and
held?

Stylus? Are you talking about a Tablet PC?
 
F

Floyd Burger

Override OnClick and use something like this:

contextMenu.Show( this, MousePosition );
 
S

Salazaar

Thanks, Floyd. Your solution works.

But, I still have a problem. The context is displayed on the click event,
but it is ALSO displayed on the tap-and-hold event. Is there is a way I can
block this event from occuring on the control and handle only the Click
event?

Perhaps I could override the MouseDown or some other combination of events
to let only the click event pass through.

Regards.
 

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