Windows Forms Designer for .NET Core Released
Today we’re happy to announce that the Windows Forms designer for .NET Core projects is now available as a preview in Visual Studio 2019 version 16.6! We also have a newer version of the designer available in Visual Studio 16.7 Preview 1!
Don’t forget to enable the designer in Tools > Options > Environment > Preview Features.
Many of you may remember that we open-sourced Windows Forms and ported it to .NET Core with .NET Core 3.0. Since then, we’ve been hard at work bringing the Windows Forms designer experience to .NET Core. While we are getting closer to completion, we are continuing work on the designer and plan on bringing more functional and performance improvements in the near future.
How to use the designer
- Install Visual Studio 2019 version 16.6 or Visual Studio 2019 version 16.7 Preview 1.
- To enable the designer in Visual Studio, go to Tools > Options > Environment > Preview Features and select the Use the preview Windows Forms designer for .NET Core apps option.
After completing these steps, once you double-click on your form in the Solution Explorer, the designer will open automatically the same way it is for .NET Framework applications.
Improving the performance is our next goal after we complete the functionality work, so don’t get upset if it’s not as fast as you envisioned while the designer is in the preview, that’s something we will improve in the future.
Currently the new Windows Forms designer works only on Windows 10.
What’s available in the designer
- All Windows Forms controls except
DataGridView
andToolStripContainer
(these are coming soon) UserControl
and custom controls infrastructure (only available since Visual Studio 16.7 Preview 1 version)- All designer functionality, such as
- drag-and-drop
- selection, move and resize
- cut/copy/paste/delete
- integration with Properties Window
- events generation and so on
- New
WebView2
control This chromium-based embedded browser control allows to render web content (HTML/CSS/JavaScript) for .NET apps. It is supported in both .NET Core and .NET Framework platforms for Windows Forms and WPF applications. You can find a getting started tutorial in the Microsoft documentation and we will publish a blog post dedicated to WebView2 control in the nearest future. - Local resources
- Partial support for localization
- Localizable properties of the controls and UserControl can be serialized into ResX-files (by setting
Localizable
property totrue
). - Different languages are supported via changing
Language
property. - Additional
Cultures
are added in the preview of .NET 5 according to the International Components for Unicode Standard (ICU).
- Localizable properties of the controls and UserControl can be serialized into ResX-files (by setting
What’s coming next
- Project resources
- Complete localization
- Inherited dialogs support
- Data binding scenarios
This work is in progress, and you already can see some results in the Visual Studio 16.7 Preview 1 designer.
- Third-party control vendors support
New in 16.6 GA release
- All Dialogs controls
PropertyGrid
HScrollBar
VScrollBar
DomainUpDown
TrackBar
- Drag-and-drop improvements
- Selection improvements
- Stability and bug fixes
New in 16.7 Preview 1 release
UserControl
and custom controls infrastructureTableLayoutPanel
- Fundamentals for third-party controls support
- Fundamentals for data binding support
- Improvements in designer interaction with the
TableLayoutPanel
Known issue
Some users might not see some controls (like Button, CheckBox, etc.) in the Toolbox. That happens due to the Toolbox cache corruption issue that will be fixed in the next version. Meanwhile, there is a simple way to fix it on your machine:
- Right-click on the Toolbox > Choose Items…
- In the Choose Toolbox Items dialog click “Reset” button
This should fix the problem.
Give us your feedback!
Your feedback is important to us! Please report issues and send feature requests via the Visual Studio Feedback channel. Use the “Send Feedback” icon in Visual Studio top-right corner as shown in the following image and specify that it is related to the “WinForms .NET Core” area.
Related links
Getting started:
- Creating your first Windows Forms app on .NET Core
- Creating your first WPF app on .NET Core
- Differences between .NET Framework and .NET Core for desktop apps
Porting
- Simple porting case
- Advanced porting case (Part 1, Part 2)
- Overview of the porting process
70 comments
can’t wait to see it all complete. and fully supported by devexpress controls.
this webview2 control should find it’s way to the existing .net 4.7 4.8 winforms in vs2017 😭😭😭
Hi Johnnyxp64,
WebView2 does support .NET 4.7, 4.8 WinForms and Visual Studio 2017. Is there an issue you are running into?
https://docs.microsoft.com/en-us/microsoft-edge/webview2/gettingstarted/winforms
If you don’t mind can you follow up on the WebView2 feedback channel?
https://github.com/MicrosoftEdge/WebViewFeedback
Thanks!
It has the potential for being nice, and shows that Microsoft has been busy. But until it is implemented also on Linux, it isn’t ‘cross-platform’ and of little use for me. As for use on Windows, it really needs to be made compatible with Windows 7. Making anything Windows 10-only is simply beating a dead horse where there’s no future. So you’ll need to backport all this to Visual Studio 13, since newer versions of Visual Studio don’t play well with Windows 7.
I would be very curious to hear about your scenario where you need Linux support. Would be great to know what kind of app you are developing, which distro you want to run on, what framework are you targeting right now, who are your users, what % of them are on Linux, how does your UI looks like for app that you want to run on Linux, do you want the UI of your app on Linux look exactly like your app on Windows or have a native Linux look?
Steve Tabler and everyone who is interested in WinForms on Linux/MacOS, please send me your responses at oliag@microsoft.com or respond here. Your feedback would help us better understand your needs 🙂
You’re only here to whine. Obviously MS isn’t going to “backport” this to a 7 year old IDE that’s been superseded 3 times by times by now so they can support an OS that’s well, officially no longer supported. Get over it.
When is MFC support coming?
We have support for C++/CLI in .NET Core 3.1, but I’m not sure what support do you need exactly. Could you provide more info on what are you trying to do in this item.
Thank you very much for sharing, the new WinForms project will be planned for use.
Very happy to hear that! 🙂
can we use .NET Core to open and connect a comPort like we do with .NetFramwork?
Will this be aviable?
Yes, SerialPort is already available in .NET Core
Hi, do you have any example in a video?
I can’t find “System.IO.Ports” in .NET Core
//This doesn’t work in vscode
using System.IO.Ports;
Hi, did you add System.IO.Ports package to your C# project?
Here is an example of .csproj:
Hi please guid me i have update my Visual Studio 2019 16.5.4 to new 16.6.0.But there is no Button control in the toolbox for winforms .net core.
This is a known issue that reproduces for some cases, we are fixing it. Meanwhile to fix it:
1. right-click on the Toolbox > Choose Items…
2. In the Choose Toolbox Items dialog “Reset”
I apply (Reset) but it didn’t solve the issue, Button is invisible 🙂
That worked for me. Thanks!
Its good to see Winforms being carried forward. I am starting to write a WPF MVVM app and while this approach has some advantages, it is quite time-intensive to produce a UI and the ViewModel->View comms and nav between views is a learning curve. I get it though better separation of concerns and less reliance on older graphics libraries.
That said, if you need to produce something simple and quickly Winforms brings it every time. If you do it right the forms have should have minimal non-UI code so a good architecture is still perfectly possible.
Thank you for the feedback Jonathan! 🙂
Hi, first off thank you for your efforts.
I’m using VB.Net on NetCore (VS 16.7 Pre1) and I have a question. It is normal that file size of NetCore builds are greater than NetFramework? About 15x times compared to NetFramework? A new template with one form has 12kb on Netfx while 177kb on net core.
Thanks
Hello, I think I found a bug in 16.7 pre1.
If you write the CurDir() function without set_value or return_value to a variable then it didnt show as error. Found it by replacing My.Computer.Filesystem Namespace to alternatives.
VB.Net
Sub Test()
FileSystem.CurDir()
End Sub
edit: Seems affected “functions” of the Microsoft.VisualBasic.FileSystem Module too.
I’m impressed with this, but what about forms & wpf designer for other platforms like Linux and Mac ?