WPF or Windows Forms

I have been playing with C # console applications for about a year, and I want to move on to creating graphical applications. I have never done any GUI except for basic Java applications, but I want to continue using C #. Should I start learning Windows Forms or go straight to WPF? Is there a huge difference? Does WPF create on top of Windows Forms or are they completely different?

+59
c # windows winforms wpf
Apr 21 '10 at 17:29
source share
4 answers

If you are just starting out, jump right into WPF.

This will allow you to start creating rich interfaces using markup to define your interface without teaching you the possible bad habits (for WPF) that you learn from Windows Forms.

+59
Apr 21 '10 at 17:32
source share

These two are completely different technologies. They offer some levels of compatibility in both directions, but apart from that they have nothing in common. Windows Forms is a more or less lightweight shell on top of Win32 / MFC , which means that its extensibility in .NET is not always good in all cases. WPF is a new user interface, implemented from scratch. WPF is also much more flexible when it comes to customizing existing types.

However, at least in my experience, Windows Forms seems to be the industry's most widely used desktop UI. Windows Forms cannot be used with web development, although WPF offers Silverlight and XBAP applications.

If you have already done any UI development, I would dare say that Windows Forms is easier to learn, since it follows more traditional programming paradigms. The WPF programming model is different from this. Although WPF can be used in the same way as Windows Forms, most of its benefits are not achieved until you enable data binding and WPF encapsulation.

Despite the fact that some of the arguments for Windows Forms that choose WPF over Windows Forms will not be a problem for me if all you want to do is learn the interface. It surpasses Windows Forms in all aspects. I just want the software industry as a whole to adapt it on a wider scale! (Although not like no one writes desktop applications anymore, since we got the Internet.)

+19
Apr 21 '10 at 17:42 on
source share

WPF provides very rich capabilities for creating extremely complex user interfaces. This simplifies the integration of hardware-accelerated graphics in your interface. However, the WPF Visual Studio designer is really bad (I almost never use it). I also find that WPF is much more complicated and harder to start with. But this, of course, is subjective.

+3
Apr 21 '10 at 17:50
source share

Both technologies have their own pro and con.

WPF is better suited for cross-platform development and for creating flashy GUIs. However, this requires a newer .net infrastructure than WinForms, and it requires a dx9 compatible graphics processor or higher (which most people will have).

But this is a bit more related to creating an interface / connecting all events, etc.

WinForms is still a powerful technology that can often be developed faster than WPF. In the end, both technologies can be used to achieve the same. However, WPF is the "new" Standard.

WinForms is commonly used to develop business applications, while WPF is often used to create additional software components, applications, etc. on end users.

+2
Nov 30 '17 at 14:33
source share



All Articles