tap-and-hold coordinates

D

Dean

Hi,
I'm sure I'm missing something totally obvious, but I
can't quite figure out how to get tap-and-hold
coordinates. I have added a context menu to a list box,
and need to know where the tap-and-hold occurred so I can
then do a hit test to figure out which list item the tap
occurred over. My problem is that it doesn't appear that
mousedown events are fired if it's a tap-and-hold. And the
ContextMenu.Popup event doesn't give you coordinates like
the mosedown event does. Any ideas how to detect where the
tap-and-hold occurred?

Thanks a bunch,
Dean
 
R

Reed Robison [MS]

Dean,

If you do something like check the Control.MousePosition info inside the
Popup event handler, this should get you pretty close.

contextMenu1.Popup += new System.EventHandler(this.MyPopupEventHandler);
....
protected void MyPopupEventHandler(System.Object sender, System.EventArgs e)
{
textBox1.Text = Control.MousePosition.X.ToString() + ":" +
Control.MousePosition.Y.ToString();
}
Hope this helps,

Reed Robison
DST Premier Services

This posting is provided "AS IS" with no warranties, and confers no rights.

Check out Mobility Development FAQs at
http://msdn.microsoft.com/mobility/prodtechinfo/devtools/netcf/FAQ/default.aspx


Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm"
 

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