dotnet / winforms

Windows Forms is a .NET UI framework for building Windows desktop applications.
MIT License
4.42k stars 984 forks source link

Support designer capabilities at runtime #4908

Closed RussKie closed 1 year ago

RussKie commented 3 years ago

Context

The Windows Forms SDK consist of two distinct parts – the runtime (the code that executes, open sourced in this repo) and the designer (consists of the "general purpose" and "Visual Studio-specific" components, close sourced). In .NET Framework these two parts lived together, and that allowed customers to invoke and use VS-specific functionality. Skip forward to .NET Core/.NET and these two components are now split and evolve (for the most part) independently of each other.

The more and more customers are starting to migrate their apps to .NET the more we see the demand to the missing designer capabilities to be ported over to .NET (e.g. #1395, #2573, #4456, #4886, #4887, AB#1314797).

In scope:

However we need to port the general purpose designer infrastructure – i.e. API that enable building "a designer that the user can embed in their application". For example, a user might have a business application that contains a report designer feature, which can use our "general designer" framework.

Open for consideration

The following API may be considered for porting upon significant demand and real use cases.

Out of scope

RussKie commented 3 years ago

Known Issues

mansai commented 2 years ago

NET 6.0 Support designer System.Windows.Forms.Design.DataGridViewDesigner

The VS-specific designer functionality will be made available, because it makes very sense outside the VS.

For example: User form Designer

RussKie commented 2 years ago

Please elaborate and explain a use case where VS-centric designers is required outside VS.

merriemcgaw commented 1 year ago

We are reopening this issue to collect requests for specific designers not yet implemented.

dmitrii-drobotov commented 1 year ago

https://github.com/dotnet/winforms/issues/8749 - SplitContainerDesigner https://github.com/dotnet/winforms/issues/8790 - TablelayoutPanelDesigner, TabControlDesigner

LeafShi1 commented 1 year ago

@Tanya-Solyanik Currently four designers have not been ported.

The two controls are COM components. I tested these two designers according to the following steps,

_Creating ActiveX Control in Windows Forms Application_

1. Create a new MFC ActiveX Control project with name

MFCActiveXControl. Click Finish on setting window and build MFCActiveXControl.

2. Get file MFCActiveXControl.ocx from the Debug folder.

_To registe an ActiveX control with ocx file_

1. Copy AxImp.exe from SDK path and the ocx file to a new folder c:\school for instance.

2. Open a Command Prompt as Administrator and run command line

regsvr32.exe c:\school\{ocx file name}.

In this test the command line is

“regsvr32.exe c:\school\MFCActiveXControl.ocx”.

3. Run command line cd c:\school to locate\\ the path of AxImp.exe and run command line AXImp.exe MFCActiveXControl.Ocx.

_To test the ActiveX control in Windows Forms Application_

1. Open project Prj1, add a Tab to Toolbox named AxtiveXControl. Right Click to select Choose Items…, and choose COM Components, select MFCActiveXControl, and click OK.

2. Drag the MFCActiveXControl to the Form.

3. Build and run.

but there are some problems when Drag the MFCActiveXControl to the Form. .netFramework App image

.netcore app image

And on the .Net Core designer, support for these two controls (AxHost/COM Control support in designer, Enable ActiveX Support) is still in progress.

Tanya-Solyanik commented 1 year ago
  1. ActiveX related designers can be done later. Please create a new bug for them. WebBrowser control is backed up by and ActiveX as well, so it will be covered by that bug as well. We will use that bug for tracking any user requests.
  2. Since StatusBar control is deprecated, please cross out this designer from the list.
Tanya-Solyanik commented 1 year ago

Let's close this one again when all outstanding PRs are merged.

LeafShi1 commented 1 year ago
  1. ActiveX related designers can be done later. Please create a new bug for them. WebBrowser control is backed up by and ActiveX as well, so it will be covered by that bug as well. We will use that bug for tracking any user requests.
  2. Since StatusBar control is deprecated, please cross out this designer from the list.

Track ActiveX related designers with issue #9810