// ...
// 在 uses 中加入 JvCaptionButton
uses
... , JvCaptionButton;
type
TForm1 = class(TForm)
procedure FormCreate(Sender: TObject);
private
// 加入 TJvCaptionButton 和 bonclick TNotifyEvent
b: TJvCaptionButton;
procedure bonclick(Sender: TObject);
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.bonclick(Sender: TObject);
begin
ShowMessage('Hello');
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
B := TJvCaptionButton.Create(self);
B.Caption := 'A';
B.onclick := bonclick;
end;
// ...
執行程式後 Caption 上就會多一個 'A' Button 了
沒有留言:
張貼留言