A discussion. Only one Windows Forms control can be nested within the WindowsFormsHost. But we can use a control such as TableLayoutPanel that can have sub-controls.
Detail In the example, I added a Click event handler. When the user clicks on the Button, the Button_Click event handler runs.
And The Text attribute of the Button is changed to the word "Clicked." This is not a WPF Button, which uses Content.
A summary. Based on my experiment with WindowsFormsHost, it seems that avoiding this element is an ideal choice. Using it introduces a lot of extra complexity.
Dot Net Perls is a collection of pages with code examples, which are updated to stay current. Programming is an art, and it can be learned from examples.
Donate to this site to help offset the costs of running the server. Sites like this will cease to exist if there is no financial support for them.
Sam Allen is passionate about computer languages, and he maintains 100% of the material available on this website. He hopes it makes the world a nicer place.
This page was last updated on Sep 28, 2022 (edit).