pegar quem executando o evento atual

Delphi

15/01/2007

Olá, preciso saber quem esta executando o procedure Tmov_bancario.FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
quero saber quem executou .. se foi o botao X, y

abraços


Fabiotb

Fabiotb

Curtidas 0

Respostas

Aroldo Zanela

Aroldo Zanela

15/01/2007

Colega,

Tem certeza que precisa disso? É algo realmente não muito usual. Segue uma maneira:

  if ( Sender is TButton) then
  begin
    if (Sender as TButton).Caption = ´btn1´ then
      ShowMessage(´Botão 1´) else
    if (Sender as TButton).Caption = ´btn2´ then
      ShowMessage(´Botão 2´);
  end;



GOSTEI 0
POSTAR