⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 with.pas

📁 FastScript 1.94 Full Source
💻 PAS
字号:
{**************************}
{ FastScript v1.0          }
{ With operator demo       }
{**************************}

var
  f: TForm;
  b: TButton;

procedure ButtonClick(Sender: TButton);
begin
  ShowMessage(Sender.Name);
  f.ModalResult := mrOk;
end;

// there is no necessary to use all parameters 
// in the event handlers
// because no type checking is performed
procedure ButtonMouseMove(Sender: TButton);
begin
  b.Caption := 'moved over';
end;

begin
  f := TForm.Create(nil);
  with f do
  begin
    Caption := 'Test it!';
    BorderStyle := bsDialog;
    Position := poScreenCenter;
  end;

  b := TButton.Create(f);
  with b do
  begin
    Name := 'Button1';
    Parent := f;
    SetBounds(10, 10, 75, 25);
    Caption := 'Test';

    OnClick := @ButtonClick; { same as b.OnClick := 'ButtonClick' }
    OnMouseMove := @ButtonMouseMove;
  end;

  with f do
  begin
    ShowModal;
    Free;
  end;
end.

⌨️ 快捷键说明

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