Intro to Windows Forms

One way to build graphical user interfaces (GUI) for Windows is with Windows Forms (WinForms). It lets you build rich client applications with an event-driven design. Although it has already been succeeded by WPF, another graphical library in the .NET framework, it is still supported by Microsoft today. Many developers still use WinForms for rapid GUI development, existing in-house tools, and educational purposes.

In WinForms, a form is basically a window or dialog box where you can add controls to receive user interactions or show output, such as via a label, text box, or button. With Microsoft’s Visual Studio IDE, adding a control is a simple drag and drop. Clicking a control will reveal its properties in the Visual Studio window where you can change its values. In addition, every object has a set of events, such as a click event, that you can handle with code.

In the video above, I show how to create a simple tip calculator using WinForms. The programming language I use is C#, but you could use Visual Basic instead. If you would like to learn more about creating a WinForms application, please leave a comment below.


Comments

pac-sama
pac-sama
Reply

Why did you choose to use an else if instead of a case statement homie?
Good video! Useful

Austin
Austin

Thank you for watching! For the scenario in the video, an if statement is the best type of control structure because we’re checking three separate values: the Checked property from each of the radio buttons. A switch statement would only work if we were evaluating against one value that has multiple conditions.

Loading...