COVID-19: Choose between our familiar (but now socially distanced) classroom training courses and our excellent new live online courses.
Why you should develop systems in WPF, not WinForms
Part two of a eleven-part series of blogs

Posted by Andy Brown on 25 September 2012

You need a minimum screen resolution of about 700 pixels width to see our blogs. This is because they contain diagrams and tables which would not be viewable easily on a mobile phone or small laptop. Please use a larger tablet, notebook or desktop computer, or change your screen resolution settings.

1 - WPF Forms are Quicker to Create

This should come with a proviso: once you've learnt XAML, it's quicker.

Designing a Form in WinForms

To create the form shown at the start of this blog in Windows Forms, I had to drag controls onto a form, position them correctly and then change their properties:

Dragging a control onto a form The properties of a button
Drag controls on ... ... then change their properties

Designing a Form in WPF

For the same process in WPF, you type in the XAML:

Typing XAML for a button

Provided that you know the main tags and attributes and can type reasonably quickly, creating this button is faster in XAML.


The speed difference particularly shows when you want to copy and paste controls:

Two buttons in XAML

The two buttons are similar; I created them by copying the OK button and editing it.

If you're a slow two-fingered typist, you might be better off sticking to WinForms.

This blog has 0 threads Add post