WindowsFormsHost不会调整面板大小 [英] WindowsFormsHost doesn't resize panel
本文介绍了WindowsFormsHost不会调整面板大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正尝试在WindowsformsHost控件中托管面板,如下所示:
Hi I am trying to host a Panel in a WindowsformsHost control as follows:
<DockPanel LastChildFill="true" Grid.Column="1" Grid.ColumnSpan="2">
<WindowsFormsHost Name="FormsHost" Background="Aqua" Height="{Binding ElementName=RootWindow, Path=ActualHeight}" Width="{Binding ElementName=RootWindow, Path=ActualWidth}">
<wf:Panel Dock="Fill" x:Name="basePanel" AutoSize="True" />
</WindowsFormsHost>
</DockPanel>
由于某些原因,面板在应用程序调整大小时不会调整大小.
for some reason the panel doesn''t resize when the application does. Has anyone got any ideas?
推荐答案
尝试将高度/宽度"绑定到扩展面板的高度/宽度而不是根窗口上.
Try binding the Height/Width to your dockpanel''s height/width instead of the rootwindow.
这篇关于WindowsFormsHost不会调整面板大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文