unit1.pas

来自「DELPHI经典程序」· PAS 代码 · 共 50 行

PAS
50
字号
unit Unit1;

interface

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

type
  TForm1 = class(TForm)
    MainMenu1: TMainMenu;
    File1: TMenuItem;
    Open1: TMenuItem;
    Close1: TMenuItem;
    Edit1: TMenuItem;
    Cut1: TMenuItem;
    Copy1: TMenuItem;
    Exit1: TMenuItem;
    ImageList1: TImageList;
    NewTxtFile1: TMenuItem;
    NewDocFile1: TMenuItem;
    N2: TMenuItem;
    N1: TMenuItem;
    procedure Exit1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}


procedure TForm1.Exit1Click(Sender: TObject);
begin
  if MessageDlg('现在要离开了吗?',
    mtConfirmation, [mbYes, mbNo], 0) = mrYes then
   begin
    MessageDlg('请再度光临!', mtInformation,[mbOk], 0);
    Close;
   end;
end;

end.

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?