compile error
the following line get errors: (wfh.Child as MyControl1).OnButtonClick += new MyControl1.MyControlEventHandler(Pane1_OnButtonClick);
Error 3 Cannot convert type 'System.Windows.Forms.Control' to 'MyControls.MyControl1' via a reference conversion, boxing conversion, unboxing conversion, wrapping conversion, or null type conversion c:\users\ttang\documents\visual studio 2013\Projects\WpfHost\WpfHost\MainWindow.xaml.cs 68 14 WpfHost Error 4 Cannot implicitly convert type 'System.Windows.Forms.Control' to 'object' c:\users\ttang\documents\visual studio 2013\Projects\WpfHost\WpfHost\MainWindow.xaml.cs 68 14 WpfHost Error 2 The type 'System.Windows.Forms.Control' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. c:\users\ttang\documents\visual studio 2013\Projects\WpfHost\WpfHost\MainWindow.xaml.cs 68 13 WpfHost Error 1 The type 'System.Windows.Forms.UserControl' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. c:\users\ttang\documents\visual studio 2013\Projects\WpfHost\WpfHost\MainWindow.xaml.cs 68 13 WpfHost
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
- ID: bfa7232e-6d73-18db-fbc4-c210831d9de5
- Version Independent ID: f137c552-0b9a-64e1-dae7-2238be224222
- Content: Walkthrough: Hosting a Windows Forms Composite Control in WPF
- Content Source: docs/framework/wpf/advanced/walkthrough-hosting-a-windows-forms-composite-control-in-wpf.md
- Product: dotnet-framework
- GitHub Login: @dotnet-bot
- Microsoft Alias: dotnetcontent
This issue has been closed as part of the issue backlog grooming process outlined in #22351.
That automated process may have closed some issues that should be addressed. If you think this is one of them, reopen it with a comment explaining why. Tag the @dotnet/docs team for visibility.