【问题标题】:form not showing properly in MDIParent when formborderstyle is set to FixedSingle当 formborderstyle 设置为 FixedSingle 时,表单无法在 MDIParent 中正确显示
【发布时间】:2013-01-30 19:01:15
【问题描述】:

我正在使用 VB.NET (Visual Studio 2010)

我已将 formborderstyle 设置为 FixedSingle 并从代码中最大化表单

With Form1
   .MdiParent = MdiParent1
   .BackColor = FormColor
   .WindowState = FormWindowState.Maximized
   .Show()
End With

当我在 Windows Xp 中测试时一切都很好 但在 Windows 7 中,窗体的角隐藏在 MDIParent 中,因此窗体的 Menustrip 和 StatusStrip 无法正常显示。

如果用户在 Windows 7 中最小化和最大化表单,那么一切都很好。

我该如何解决这个问题??

【问题讨论】:

  • 这是 Winforms 中的一个小缺陷,当您执行此操作时它会忘记抛出异常。 MDI 仅支持具有可调整边框的子窗口。您无法完成这项工作,请将 FormBorderStyle 改回 Sizable。
  • @HansPassant,好的,我明白了

标签: c# vb.net visual-studio-2010


【解决方案1】:

您可以使用 ClientSize 属性,这将避免不同操作系统上的不同大小

【讨论】:

  • 如何将它用于显示表单??
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2020-10-25
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2014-08-24
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多