confdial.pas

来自「Delphi编程实效百例的随书程序 这是其中的界面操作部分」· PAS 代码 · 共 60 行

PAS
60
字号
unit Confdial;

interface

uses
  Windows, Classes, Graphics, Forms,
  Controls, Buttons, StdCtrls, ExtCtrls;

type
  TConfigureDialog = class(TForm)
    BitBtn1: TBitBtn;
    BitBtn2: TBitBtn;
    CheckBox1: TCheckBox;
    CheckBox2: TCheckBox;
    BitBtn3: TBitBtn;
    RadioGroup1: TRadioGroup;
    procedure BitBtn3Click(Sender: TObject);
    procedure FormCreate(Sender: TObject);
    procedure FormActivate(Sender: TObject);
  private
    { Private declarations }
  public
    OldHeight, NewHeight: Integer;
  end;

var
  ConfigureDialog: TConfigureDialog;

implementation

{$R *.DFM}

procedure TConfigureDialog.BitBtn3Click(Sender: TObject);
var
  I: Integer;
begin
  BitBtn3.Enabled := False;
  for I := ClientHeight to NewHeight do
  begin
    ClientHeight := I;
    Update;
  end;
end;

procedure TConfigureDialog.FormCreate(Sender: TObject);
begin
  configuredialog.Color:=clsilver;
  OldHeight := ClientHeight;
  NewHeight := RadioGroup1.height+RadioGroup1.Top+10;
end;

procedure TConfigureDialog.FormActivate(Sender: TObject);
begin
  ClientHeight := OldHeight;
  BitBtn3.Enabled := True;
end;

end.

⌨️ 快捷键说明

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