开发者

Putting a windowsformhost inside a usercontrol

开发者 https://www.devze.com 2023-03-30 14:03 出处:网络
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 windows

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

精彩评论

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