如何防止 Delphi MDI 应用程序显示最大化子项的标题

发布于 2024-07-14 15:20:28 字数 75 浏览 4 评论 0原文

如何防止 Delphi MDI 应用程序在 MDI 父窗体的标题中显示当前最大化的 MDI 子项的标题?

先感谢您!

how can I prevent a Delphi MDI application from showing the caption of the currently maximized MDI child in the caption of the MDI parent form?

Thank you in advance!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

冬天的雪花 2024-07-21 15:20:29

按照 mghie 的建议调整 Gerry 的答案:

private
  PreviousState: TWindowState;

procedure TMDIChildForm.FormResize(Sender: TObject);
begin
  if PreviousState = wsMaximized then
    Caption := 'Desired Caption'
  else if WindowState = wsMaximized then
    Caption := '';
  PreviousState := WindowState;
end;

Tweaking Gerry's answer as mghie suggested:

private
  PreviousState: TWindowState;

procedure TMDIChildForm.FormResize(Sender: TObject);
begin
  if PreviousState = wsMaximized then
    Caption := 'Desired Caption'
  else if WindowState = wsMaximized then
    Caption := '';
  PreviousState := WindowState;
end;
愁杀 2024-07-21 15:20:29

你不能。 MDI 已经过时了,并且对它的支持已被弃用(实际上,已经弃用多年了)。 由于弃用,这些限制可能永远不会改变。

You can't. MDI is outdated stuff, and support for it is deprecated (actually, it has been for years). The limitations probably won't ever be changed because of the deprecation.

奈何桥上唱咆哮 2024-07-21 15:20:28

还没有机会对此进行测试,但是:

在子 OnResize 中,测试 WindowState = wsMaximized。
如果是,则设置 Caption := ''
如果没有,请根据需要设置标题 - 您需要记住这一点。

haven't had a chance to test this, but:

in the child OnResize, test for WindowState = wsMaximized.
If it is, then set Caption := ''
If not, set caption as required - you will need to need to remember this.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文