unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
Menus, ComCtrls, ToolWin;
type
TForm1 =
class(TForm)
ToolBar1: TToolBar;
ToolButton1: TToolButton;
ToolButton2: TToolButton;
ToolButton3: TToolButton;
PopupMenu1: TPopupMenu;
MenuItem11: TMenuItem;
procedure MenuItem11Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure ToolButton3MouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
private
{ Private declarations }
LastSender : TToolButton;
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.MenuItem11Click(Sender: TObject);
begin
showmessage(LastSender.
Name);
//oder was auch immer mit dem Object machen
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
LastSender := TToolButton.Create(self);
end;
procedure TForm1.ToolButton3MouseMove(Sender: TObject; Shift: TShiftState;
//im OnMouseMove aller Buttons
X, Y: Integer);
begin
LastSender :=Sender
as TToolButton;
end;
end.