开发者

Putting a windowsformhost inside a usercontrol

I'm trying to put a windowsformshost inside a WPF UserControl. Whenever I shrink the size of the UserControl the windowsformshost seems bleed out of the UserControl? Is there anyway to make the windowsformshost stay inside the usercontrol? I saw some examples online but none of them work. I am putting the windowsformshost inside a grid. Is there someplace else I have to place i开发者_如何转开发t? Thank you in advance for the help.

David


If you want your WindowsFormHost always have width and height like your parent control, you can

1) Put it to the DockPanel with LastChildFill="True"

2) Bind to the ActualWidth and ActualHeight of your parent control (either Grid or UserControl) with the width and height of your WindowFormHost.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜