Selecting the best GUI toolkit – part 4: Windows Forms

This is the fourth part of a series started with this article: https://codehouse.digfish.org/selecting-the-best-widget-toolkit-1/

·

2 min read

Selecting the best GUI toolkit – part 4: Windows Forms

NOTE: this the fourth part of a series. The previous article was about AutoHotkey. You can find the article here. Windows Forms is a GUI programming framework developed by Microsoft for building Windows desktop applications. It provides a set of pre-built controls that developers can use to create user interfaces for their applications. It was the first Toolkit developed with the release of the first .NET frameworks, coping with the experience Microsoft acquired with MFC and Visual Basic Forms. Microsoft release Windows Forms as open-source in 2018, but its scope is still limited to Microsoft in-house technologies, and its ports using the MonoFramework are limited. Compared to tkinter and AutoHotkey, Windows Forms offers a richer set of controls and a more modern look and feel. It also has strong support for data binding, which can simplify the development of data-driven applications. The WinForms repository is available here.

Since Microsoft provides Visual Studio standard for free, I switched to using Visual Studio for this implementation. You can design the form and then complete the events handlers source later and return to the design mode again. VS keeps the source code for the widgets in sync when returning for design mode. It's the advantage you get when working with a toolkit from the same toolmaker. After reading some tutorials and reusing the source code provided, I could accomplish the end of the implementation in less time than comparing with the two prior implementations. The code for the event handlers is very intuitive. Drag'n'Drop is supported, and I made it to work with not many complexities. One drawback is that the .NET doesn't bring JSON support out of the box, I had to use the NuGet package manager to install it.

One great debugging feature that I enjoyed, and the other IDEs don't possess, it's the ability to apply changes immediately to the already running application being debugged. It avoids the need to restart the whole execution of the application all over again.

One potential downside of Windows Forms is that it is limited to Windows operating systems, so your applications won't be cross-platform. Additionally, it may require more knowledge of the .NET Framework and Windows development in general, which could make it more challenging for beginners to get started with. I didn't try the code with Mono on MacOS and Linux since it was very probable to do changes to the code. Perhaps with the new versions of .NET Core for Linux and MacOS that need will disappear !

The source code for this project is available at GitHub.