您的位置:首页 > 编程语言 > Delphi

delphi:点关闭按钮窗口最小化

2010-05-25 12:12 369 查看
点击关闭按钮让窗体最小化
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本文出自 “风起云涌” 博客,请务必保留此出处http://gzkhrh.blog.51cto.com/30447/320777
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐