Registriert seit: 29. Mai 2002
Ort: Frankfurt
8.252 Beiträge
Delphi 2006 Professional
|
Re: Mouse Leave in Panel
20. Nov 2004, 11:38
Hai faux,
hier mal ein Beispiel:
Delphi-Quellcode:
type
TForm1 = class(TForm)
Panel1: TPanel;
procedure FormCreate(Sender: TObject);
private
{ Private-Deklarationen }
procedure CMMouseEnter(var Message: TMessage); message CM_MOUSEENTER;
procedure CMMouseLeave(var Message: TMessage); message CM_MOUSELEAVE;
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.FormCreate(Sender: TObject);
begin
Panel1.Caption := '';
end;
procedure TForm1.CMMouseEnter(var Message: TMessage);
var
ptWork : TPoint;
begin
GetCursorPos(ptWork);
if WindowFromPoint(ptWork) = Panel1.Handle then
begin
Panel1.Caption := 'blubb';
end;
end;
procedure TForm1.CMMouseLeave(var Message: TMessage);
var
ptWork : TPoint;
begin
GetCursorPos(ptWork);
if WindowFromPoint(ptWork) <> Panel1.Handle then
begin
Panel1.Caption := '';
end;
end;
Stephan B. "Lasst den Gänsen ihre Füßchen"
|