I have an existing Windows Forms desktop application targeting .NET Framework 4 and would like to add Windows 8 touch support to it.
Currently the program works fine in Windows 8, and I can potentially just resize some of the elements to make it more user-friendly on touch devices. However, adding gestures such as pinch-to-zoom on datagrids, and swipe support for other elements would go a long way to making the application more modern in a touch-only environment.
I'm investing in Visual Studio 2012, which will let me target .NET 4.5 and the new Windows 8 features, but does anyone know of any resources which would help me with updating my application? I'm specifically concerned about the following:
This isn't an exhaustive list by any means, but I'd really appreciate any advice from those who may have approached a similar upgrade in the past.
Windows Forms (WinForms) is a free and open-source graphical (GUI) class library included as a part of Microsoft .
NET Framework offered Windows Presentation Foundation (WPF) and Windows Forms (WinForms) as the main UI options, the cross-platform .
You can use TouchToolkit for WinForms from component one. However I think you'll have to rewrite your application to use these components.
Regarding the comment on "Inability to directly test the touch features of the application on my non-touch development machine. Microsoft's simulator only seems to support Metro apps" - I am able to run the simulator, go to the desktop in the simulator and run any app while simulating touch input - that's including WinForms apps.
Since WinForms is just a wrapper over WinAPI's native UI APIs - you can use p/Invoke to use the touch APIs that I think were added around Vista/Windows 7 timeframe. Mainly the WM_TOUCH and WM_GESTURE messages. There are plenty of examples for p/Invoking and using protected override void WndProc(ref Message m)
which are the main things you'd need to handle touch. Other than that - touch inputs are by default automatically promoted to mouse events when not handled as touch, so a lot of things just work.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With