Click here to Skip to main content
15,867,686 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I wanna detect if a user presses a touchscreen or uses a mouse to click.

I wanna do it in managed code, using .Net Framework Windows Forms, not Pinvoke, only managed.

I heard WPF has this function, can i apply it in Windows Forms?
Posted

1 solution

Refer - Recognize touch as MouseDown event[^].
Quote:
One suggestion that sounds as a plausible solution is to override WndProc and search for a WM_TOUCH event. More details here: http://stackoverflow.com/a/15785333/3330348
 
Share this answer
 
Comments
Ziya1995 23-Feb-15 7:02am    
As i understand it uses Pinvoke to make calls to unmanaged code.
I need to do everything in managed way.

WPF kinda supports touch events.
Can i apply this WPF function in Windows Forms?

If there is no managed way to do mouse down touch and recognize whether user clicks or touchs, let me know.
Not sure about this.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900