In this episode, you’ll learn how to create a desktop application using Windows Forms and C#.
We will take a closer look at how GUI frameworks work with a live code example.
In programming, GUI means “graphical user interface“, which is a system to interact visually with the users through UI controls, such as forms, buttons, text boxes, and others.
In this session, we will show you a sample desktop app based on the Windows Forms GUI framework. We will build a simple calculator, which sums two numbers.
We will get familiar with the structure and the front-end part of the app: the main form, holding the UI controls. We will look at how the app is built, by extending a class from the UI framework, from a composition of components, and how event handlers are called from the framework to respond to user interactions.
The demo code is designed to run in a Windows environment, using Visual Studio and the .NET Framework. It can’t run on Mac or Linux. Sorry, this is a limitation of the Windows Forms technology.
If you are new to programming, make sure to watch our Free Full Java Basics course! It will give you the necessary foundation to build upon and become a successful software engineer!
Windows Forms is a classic software framework for the development of Desktop graphical user interface (GUI) apps for Microsoft Windows.
It is based on the .NET platform and the C# language.
Windows Forms provides a programming model and rich UI control library for building GUI apps.
Additionally, the Visual Studio IDE provides a powerful visual UI builder for Windows Forms, where developers design the user interface by dragging and dropping UI controls and configuring their properties and events.
Windows Forms is an object-oriented framework. Your app is a “form“, which is an object-oriented class. This class inherits its functionality and behavior from a base class from the framework. Additional UI controls (such as labels, text boxes, and buttons) are added as data fields in the app class. The app UI controls are inserted into the tree of components, in the parent container.
Remember that coding is a skill, which should be practiced. To learn to code, you should write code, every day, for a long time. Watching tutorials is not enough. You should code!
We would love to hear from you, so leave a comment below saying what topics you would like to see next.