WindowsFormsHost不会调整面板大小

编程入门 行业动态 更新时间:2024-10-10 23:17:24
本文介绍了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不会调整面板大小

本文发布于:2023-07-09 20:59:52,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1088191.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:面板   大小   WindowsFormsHost

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!