Does Winforms (.NET Core 3) support all .NET Framework controls

前端 未结 2 968
南旧
南旧 2021-01-19 15:27

We have just moved to .NET and we are trying to recreate one of our old projects with C#/.NET, we have heard that .NET Core is the way to go for new projects and we are very

2条回答
  •  清酒与你
    2021-01-19 15:49

    Does Winforms (.NET Core 3) support all .NET Framework controls?

    No, it doesn't. In fact in .NET Core 3.1 some of the outdated Windows Forms controls like DataGrid, ToolBar, ContextMenu, Menu, MainMenu, MenuItem, and their child components were removed.

    You need to use DataGridView, ToolStrip, ContextMenuSrtip, MenuStrip and their child components instead.

    To see a list of removed controls and required actions for upgrade take a look at:

    • Breaking changes in Windows Forms/Removed controls

    I've noticed that not all the controls show up in the designer

    Right, the design-time support is still under development and some of the controls and feature are still not available through designer. However if you don't want to use designer, you just need run-time support, use the controls which are supported by .NET CORE 3.1 but don't have design-time support.

    Should we just wait for more mature releases or just use .NET Framework?

    At time of writing this answer, if you need to use designer on a regular basis, it's still not recommended to port your application to .NET Core. While there is builtin designer support in VS 2019 Version 16.5 Preview 1, but the designer is still under development and some important features like data-binding, some of container controls, localization, MenuStrip and ToolStrip, Visual inheritance and so on ate not available.

    To see the list of under development features take a look at:

    • Updates to .NET Core Windows Forms designer in Visual Studio 16.5 Preview 1
    • You may also want to take a look WinForms on .NET Core Roadmap .

提交回复
热议问题