unit3.pas

来自「一个让你记英语口语的小程序」· PAS 代码 · 共 57 行

PAS
57
字号
unit Unit3;

interface

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

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

var
  Form3: TForm3;

implementation

uses Unit1;

{$R *.dfm}

procedure TForm3.Button1Click(Sender: TObject);
begin
  form1.DBText1.Font.Size:=SpinEdit1.Value;
  if (CheckBox2.Checked) and (CheckBox1.Checked) then
     form1.DBText1.Font.Style:=[fsBold,fsItalic]
  else
  begin
    if CheckBox1.Checked then
    form1.DBText1.Font.Style:=[fsBold]
    else
      if CheckBox2.Checked then
        form1.DBText1.Font.Style:=[fsItalic]
        else
          form1.DBText1.Font.Style:=[];

  end;
end;

procedure TForm3.Button2Click(Sender: TObject);
begin
  form3.Close;
end;

end.

⌨️ 快捷键说明

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