unit2.pas

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

PAS
57
字号
unit Unit2;

interface

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

type
  TForm2 = class(TForm)
    CheckBox1: TCheckBox;
    CheckBox2: TCheckBox;
    CheckBox3: TCheckBox;
    Button1: TButton;
    Button2: TButton;
    procedure Button2Click(Sender: TObject);
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form2: TForm2;

implementation

uses Unit1;

{$R *.DFM}

procedure TForm2.Button1Click(Sender: TObject);
begin
    if CheckBox1.Checked and
       CheckBox2.Checked and
       CheckBox3.Checked then
         Form1.CheckBox5.State := cbChecked
      else if not CheckBox1.Checked and
              not CheckBox2.Checked and
              not CheckBox3.Checked then
                Form1.CheckBox5.State := cbUnchecked
              else
                Form1.CheckBox5.State := cbGrayed;

    Form2.Close;
end;

procedure TForm2.Button2Click(Sender: TObject);
begin
    Form2.Close;
end;



end.

⌨️ 快捷键说明

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