unit1.~pas

来自「这有很多Delphi应用的例子」· ~PAS 代码 · 共 42 行

~PAS
42
字号
unit Unit1;

interface

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

type
  TForm1 = class(TForm)
    CheckBox1: TCheckBox;
    Button1: TButton;
    RadioButton1: TRadioButton;
    RadioButton2: TRadioButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
  if CheckBox1.State=CbChecked
     then Memo1.Lines.Add('被选')
     else if CheckBox1.State=CbGrayed
             then Memo1.Lines.Add('灰显')
             else begin
                    Memo1.Lines.Add('未被选');
                    CheckBox1.State:=CbGrayed
                  end;
end;

end.

⌨️ 快捷键说明

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