• delphi将程序最小化至右下角


    程序新手,如果有不恰当的地方,请大家帮忙改正!

    1、下载并安装Raize.v5.5控件,delphi版本为:delphi 7.0。

    2、添加RzTrayIcon控件、PopupMenu控件至窗体上。

    3、程序代码示例:

    unit Unit1;

    interface

    uses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs, RzTray, ImgList, Menus;

    type
      TForm1 = class(TForm)
        RzTrayIcon1: TRzTrayIcon;
        PopupMenu1: TPopupMenu;
        N1: TMenuItem;
        ImageList1: TImageList;
        procedure N1Click(Sender: TObject);
        procedure FormClose(Sender: TObject; var Action: TCloseAction);
        procedure FormCreate(Sender: TObject);
      private
        { Private declarations }
      public
        { Public declarations }
        isclos :boolean; //用于判断是否退出程序
      end;

    var
      Form1: TForm1;

    implementation

    {$R *.dfm}

    procedure TForm1.N1Click(Sender: TObject);
    begin
       isclos := true;     
       form1.Close;
    end;

    procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
    begin
     if isclos then     //如果要退出程序,isclos必须为真
      begin
        action := cafree;
      end
      else begin
      action := canone;
      application.Minimize;
      end;
    end;

    procedure TForm1.FormCreate(Sender: TObject);
    begin
        isclos := false;  // 将程序退出判断设为false,即不退出程序
    end;

    end.

  • 相关阅读:
    cf B. Vasily the Bear and Fly
    hdu 3339 In Action
    hdu 六度分离
    cf A. Vasily the Bear and Triangle
    cf C. Secrets
    2.19学习笔记|2.20学习笔记
    VAE代码学习
    2.9日学习记录
    deconvolution反卷积(待学习)
    gamma分布学习
  • 原文地址:https://www.cnblogs.com/jijm123/p/10849428.html
Copyright © 2020-2023  润新知