您现在的位置:首页 >> 界面报表 >> 界面报表 >> 内容

Delphi中判断窗体最大化和最小化事件

时间:2011/9/3 15:24:20 点击:

  核心提示:unit Unit1; interface usesWindows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,...

 unit   Unit1;  
  
  interface  
  
  uses  
      Windows,   Messages,   SysUtils,   Variants,   Classes,   Graphics,   Controls,   Forms,  
      Dialogs,   StdCtrls;  
  
  type  
      TForm1   =   class(TForm)  
          Button1:   TButton;  
          Button2:   TButton;  
          procedure   Button2Click(Sender:   TObject);  
      private  
      private  
      procedure   WMsyscommand(var   msg   :   Twmsyscommand);message   wm_syscommand;  
          {   Private   declarations   }  
      public  
          {   Public   declarations   }  
      end;  
  
  var  
      Form1:   TForm1;  
  
  implementation  
  
  {$R   *.dfm}  
  
  procedure   Tform1.WMsyscommand(var   msg   :   Twmsyscommand);  
  begin  
      if   msg.CmdType   =   SC_MAXIMIZE   then  
            showmessage('现在最大化')  
      else   if   msg.CmdType   =   SC_MINIMIZE   then  
            showmessage('现在最小化');  
      inherited;  
  end;  
  
  end. 

作者:Seeker 来源:原创
共有评论 0相关评论
发表我的评论
  • 大名:
  • 内容:
  • 盒子文章(www.2ccc.com) © 2024 版权所有 All Rights Reserved.
  • 沪ICP备05001939号