Thema: Delphi TPanel OnMouseExit?

Einzelnen Beitrag anzeigen

Benutzerbild von Stevie
Stevie

Registriert seit: 12. Aug 2003
Ort: Soest
4.016 Beiträge
 
Delphi 10.1 Berlin Enterprise
 
#3

Re: TPanel OnMouseExit?

  Alt 23. Dez 2004, 09:13
Moin!
Delphi-Quellcode:
type
  TPanel = class(ExtCtrls.TPanel)
  protected
    procedure WMMouseMove(var Message: TWMMouse); message WM_MOUSEMOVE;
    procedure WMMouseLeave(var Message: TWMMouse); message WM_MOUSELEAVE;
  end;

{...}

procedure TPanel.WMMouseLeave(var Message: TWMMouse);
begin
  inherited;
  if BevelOuter = bvRaised then
    BevelOuter := bvNone;
end;

procedure TPanel.WMMouseMove(var Message: TWMMouse);
var
  EventTrack: TTrackMouseEvent;
begin
  inherited;
  if BevelOuter = bvNone then
  begin
    BevelOuter := bvRaised;
    EventTrack.dwFlags := TME_LEAVE;
    EventTrack.hwndTrack := Handle;
    EventTrack.cbSize := SizeOf(EventTrack);
    TrackMouseEvent(EventTrack);
  end;
end;
MfG
Stevie
Stefan
“Simplicity, carried to the extreme, becomes elegance.” Jon Franklin

Delphi Sorcery - DSharp - Spring4D - TestInsight
  Mit Zitat antworten Zitat