Board index » delphi » Getting the caption of the toolbutton

Getting the caption of the toolbutton

In the OnClick event, Sender should be the Button, so simply typecast it
as follows:

TForm1.Toolbutton1OnClick(Sender: TObject);
begin
  ShowMessage('Button Caption: ' + TToolButton(Sender).Caption);
{or}
  ShowMessage('Button Caption: '+TButton(Sender).Caption);
end;

Quote
af wrote:
> Hi,

> How can I get the caption of the toolbutton once I have click on that
> button?

> Thankyou.

 

Re:Getting the caption of the toolbutton


Hi,

How can I get the caption of the toolbutton once I have click on that
button?

Thankyou.

Other Threads