Martynas
Martynas

Reputation: 188

Can win forms run on a tablet?

I have a vs2017 win forms application.

Would it run on a windows tablet? Do I need to change or add anything to it to make it tablet compatible? How would it handle touch input? Would it just consider it the same as a mouse click? Would it run on an android tablet? Is it possible to port it to android tablet somehow or do I need to develop a separate application for android something like a xamarin app?

These might seem like stupid question but I really have no idea how win forms application react to tablet and I don't have a table to test it on.

Upvotes: 1

Views: 2345

Answers (1)

Ray
Ray

Reputation: 8834

Windows Forms runs on a Windows 10 tablet like it does on the desktop. This means the following:

  • You should probably design it to be DPI aware and scale its elements correctly, as some tablets have a higher DPI setting. If you do not, Windows 10 already scales your elements better than previous systems of Windows, but they will look blurry and bad.
  • Touch input can only be handled with one finger and is delivered as simulated mouse clicks and drags. You cannot handle multiple fingers at once.
  • It will not run on Android (tablets). You would need to completely rewrite the UI part in Xamarin (to stay with C# and reuse your business logic). You can use Xamarin Android for a native, more-Android like development, or their cross-platform Xamarin Forms for that (which is more like WPF, using XAML and data binding to create platforms for Windows Phone, iOS and Android at the same time).

Other than that, there are of course design decisions to be made with the UI. Basically all of the Windows Forms controls are not very touch friendly and are made for classic mouse and keyboard interaction.

If you still have the choice, use UWP if you only need to target Windows 10, which in term uses WPF technology. If you need to support older systems, use WPF directly.

Upvotes: 4

Related Questions