如何设置Delphi中MDI子窗口禁止最大化功能?

2026-04-10 17:492阅读0评论SEO资讯
  • 内容介绍
  • 文章标签
  • 相关推荐

本文共计227个文字,预计阅读时间需要1分钟。

如何设置Delphi中MDI子窗口禁止最大化功能?

在Delphi MDI应用程序中,按下最大化按钮时,需要在主窗口客户区显示带的子窗口。使用Win32 API获取客户端区域,并设置子窗口的边界。代码如下:

pascalWin32Check(Win32.GetClientRect(ClientHandle, aTRect));MDIChild1.BoundsRect :=aTRect;

这样,按下最大化后,子窗口会根据主窗口的大小自动调整。

在delphi mdi应用程序中,当使用按下最大化按钮时,需要在Mainform客户区域中显示带有标题的子窗口

如何设置Delphi中MDI子窗口禁止最大化功能?

Win32Check(Windows.GetClientRect(ClientHandle, aTRect)); MDIChild1.BoundsRect := aTRect;

功能.

那么,当按下最大化按钮时,我们如何防止MDI子项被最大化?

我试过用它来做

procedure TChildText.WMSYSCOMMAND(var Message: TWMSYSCOMMAND); var aTRect:TRect; begin inherited; case message.CmdType of SC_MAXIMIZE: begin Win32Check(Windows.GetClientRect(MainForm.ClientHandle, aTRect)); BoundsRect := aTRect; end; end; end;

没有结果.

procedure TChildText.WMSYSCOMMAND(var Message: TWMSYSCOMMAND); var aTRect:TRect; begin if message.CmdType = SC_MAXIMIZE then begin Win32Check(Windows.GetClientRect(MainForm.ClientHandle, aTRect)); BoundsRect := aTRect; message.CmdType := SC_RESTORE; end; inherited; end;

本文共计227个文字,预计阅读时间需要1分钟。

如何设置Delphi中MDI子窗口禁止最大化功能?

在Delphi MDI应用程序中,按下最大化按钮时,需要在主窗口客户区显示带的子窗口。使用Win32 API获取客户端区域,并设置子窗口的边界。代码如下:

pascalWin32Check(Win32.GetClientRect(ClientHandle, aTRect));MDIChild1.BoundsRect :=aTRect;

这样,按下最大化后,子窗口会根据主窗口的大小自动调整。

在delphi mdi应用程序中,当使用按下最大化按钮时,需要在Mainform客户区域中显示带有标题的子窗口

如何设置Delphi中MDI子窗口禁止最大化功能?

Win32Check(Windows.GetClientRect(ClientHandle, aTRect)); MDIChild1.BoundsRect := aTRect;

功能.

那么,当按下最大化按钮时,我们如何防止MDI子项被最大化?

我试过用它来做

procedure TChildText.WMSYSCOMMAND(var Message: TWMSYSCOMMAND); var aTRect:TRect; begin inherited; case message.CmdType of SC_MAXIMIZE: begin Win32Check(Windows.GetClientRect(MainForm.ClientHandle, aTRect)); BoundsRect := aTRect; end; end; end;

没有结果.

procedure TChildText.WMSYSCOMMAND(var Message: TWMSYSCOMMAND); var aTRect:TRect; begin if message.CmdType = SC_MAXIMIZE then begin Win32Check(Windows.GetClientRect(MainForm.ClientHandle, aTRect)); BoundsRect := aTRect; message.CmdType := SC_RESTORE; end; inherited; end;