-2

I am interested in reusing old forms with form controls on it, not just any solution to add WPF control to a form. Why? Because this solution spares me from redesigning hundred forms that also have a WPF control on them.

Exception: Microsoft.DotNet.DesignTools.Client.DesignToolsServerException: Component of type UserControl1 could not be created. Make sure the type implements IComponent and provides an appropriate public constructor. Appropriate constructors either take no parameters or take a single IContainer parameter.

To reproduce the problem: https://github.com/hovek/WpfApp1 and try adding UserControl1 to Form1, from the Toolbox.

VS Version 17.4.2

Hrvoje Batrnek
  • 535
  • 1
  • 5
  • 15
  • "This question already has answers here:" That is not an answer! It is not the same to design in a form and to design in a WPF control. If you have a complete design in a form that requires you to do a lot of redesigning/porting to WPF control. – Hrvoje Batrnek Dec 09 '22 at 01:44

1 Answers1

0

I guess it's not possible to design on a form: https://learn.microsoft.com/en-us/dotnet/api/system.windows.forms.integration.elementhost?view=windowsdesktop-7.0

Hrvoje Batrnek
  • 535
  • 1
  • 5
  • 15