WPF 将窗口大小锁定为视图框大小
我有一个窗口,其中包含一个具有均匀拉伸的可调整大小的视图框。 然而,窗框并没有均匀拉伸。 因此,当有人调整表单大小时,表单的一个或另一个边缘会出现空白间隙。 看起来很糟糕。 有什么办法可以强制窗口均匀扩展吗? (或者另一种看待它的方式,将其锁定到视图框边界)
I have a window that contains a resizable viewbox with a uniform stretch. The window frame however does not stretch uniformly. So when someone resizes the form gaps of whitespace open up along one or another edge of the form. Looks bad. Any way to force the window to only expand uniformly? (or another way to look at it, lock it to the viewbox boundaries)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
查看
MainWindow
属性中的ResizeMode
选项。 设置为NoResize
窗口大小在运行时不会改变。
您可以将其设置为
CanMinimize
、CanResize
&CanResizeWithGrip
。Look at the
ResizeMode
option inMainWindow
property. Set asNoResize
window size will not change at run.
You can set this as
CanMinimize
,CanResize
&CanResizeWithGrip
.