Creating First Form- Desktop Application using .NET Core
NET Core 3.0 is an open-source version of WinForms and WPF which is bringing Windows desktop development to .NET Core.
The current version of .NET Core 3.0 is available with below (including upcoming) features,
- Winforms and WPF support
- Client-Side Web Development with Blazor
- UI Web Components on the Server Using SignalR
- EFCore 3.0
- + Many more features
Today in this article, we will cover below aspects,
Getting started
Prerequisites:
- Visual Studio 2019 (16.4 and above is preferred)
- .NET Core 3.0
- .NET Core Windows Forms Designer Preview 1
Let’s follow step by step process to create a .NET Core Desktop application. Today we will try to create a simple Hello world Forms application using Core 3.0 framework.
- If you have not installed Visual Studio VS 2019, Please install it from this location. Currently, it is available as a preview version.
- Visual Studio VS2019 UI look and feel has improved a lot.
- Please install .NET Core 3.0.
- Create a new project using the template of your choice.
- Multiple project templates are readily available for .NET core 3.0. Here we will use a simple desktop app template called “Windows Forms App(.NET Core 3.0)”
- Open the project solution and add a new button UI element manually “Click” and the simple message box to it. Then execute your application.
Using WinForms Designer package
If you need to use the WinForms Designer package with prebuilt Forms components could be very useful. This package isn’t yet bundled with Visual Studio but available as Visual Studio extension (“VSIX”), please install the same as from below,
https://github.com/dotnet/winforms/tree/master/Documentation/designer-releases
The WinForms Core Designer installation package (“VSIX”) package can be downloaded from here: https://aka.ms/winforms-designer.
Post-installation, please restart your Visual studio and you shall be all set.
The current preview version has below set of control available which will help you get started at least easily,
- Pointer
- Button
- Checkbox
- CheckedListBox
- ComboBox
- DateTimePicker
- Label
- LinkLabel
- ListBox
- ListView
- MaskedTextBox
- MonthCalendar
- NumericUpDown
- PictureBox
- ProgressBar
- RadioButton
- RichTextBox
- TextBox
- TreeView
Note: With the release of .NET Core 3.1, Latest Visual Studio 2019, get the built-in basic support for WinForms Core Designer toolkit out of the box. You need not have to install it separately.
Other references:
That’s all, Happy Coding!!
Summary
Please note that it is pretty much the same feel of development using windows forms in .NET Core. But surely the difference now is very impressive .NET Core framework support for your desktop applications, providing all goodies of Core framework plus performance improvements.
Please bookmark this page and share it with your friends. Please Subscribe to the blog to receive notifications on freshly published(2024) best practices and guidelines for software design and development.
Thank you !
Thanks Muller for reading!