unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs; type TForm1 = class(TForm) protected procedure WMSysCommand(var Message: TWMSysCommand); message WM_SYSCOMMAND; end; var Form1: TForm1; implementation {$R *.dfm} procedure TForm1.WMSysCommand(var Message: TWMSysCommand); begin case Message.CmdType of SC_CLOSE: begin Perform(WM_SYSCOMMAND, SC_MINIMIZE, 0); Exit; end; end; inherited; end; end.
delphi点击关闭按钮让窗体最小化
最新推荐文章于 2020-12-20 14:20:39 发布
这篇博客介绍了如何在Delphi中处理窗体关闭按钮的点击事件,通过覆盖WMSysCommand方法,使得点击关闭按钮时窗体不是关闭而是最小化。

793

被折叠的 条评论
为什么被折叠?



