Home > Software design >  Can't add custom ActiveX control to .NET WinForms app. .NET Framework WinForms app works fine
Can't add custom ActiveX control to .NET WinForms app. .NET Framework WinForms app works fine

Time:02-22

We make a C ActiveX control for years now. It's now built using VS2019.
When I create a new .NET Framework v4.8 WinForms project I can add my ActiveX control to the toolbox in VS2019 and drop it on my form.

But when I create a new .NET5 WinForms project using VS2019 or a new .NET6 WinForms project using VS2022 I can look up the ActiveX control when using Choose Items .. but when I select the control I get this error:

The following controls were successfully added to the toolbox but are not enabled in the active designer

Make sure the controls to add are compatible with the current designer and .NET Framework version

I can however create the control using code in the designer and at run-time, the application works as expected. I can't open the form in design time, that will generate an error.

Most likely I need to update my ActiveX control to make it more compatible with .NET Core, but I can't find what.
Can anybody advice?

CodePudding user response:

It seems this is by design. Microsoft decided to not put back the ability to use ActiveX controls in the Forms designer when using .NET.

When you need this, you can vote for it on https://developercommunity.visualstudio.com/t/support-for-activex-controls-in-windows-forms-desi/1435698 and perhaps before the end of the century, it will be implemented.

  • Related