type
TForm1 = class(TForm)
btnRegister: TButton;
btnCancel: TButton;
procedure btnCancelClick(Sender: TObject);
private
procedure btnRegisterClick(Sender: TObject);
procedure WMCommand(var Message: TWMCommand); message WM_COMMAND;
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.btnCancelClick(Sender: TObject);
begin
Close;
end;
procedure TForm1.btnRegisterClick(Sender: TObject);
begin
ShowMessage('Thx for ur registration.');
end;
procedure TForm1.WMCommand(var Message: TWMCommand);
begin
if Message.NotifyCode = BN_CLICKED then
if FindControl(Message.Ctl) = btnRegister then
begin
btnRegisterClick(Self);
Exit;
end;
inherited;
end;