Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   GUI-Design mit VCL / FireMonkey / Common Controls (https://www.delphipraxis.net/18-gui-design-mit-vcl-firemonkey-common-controls/)
-   -   Delphi BitBtn-Icon bei OnMouseLeave wieder das altes Bild zurück (https://www.delphipraxis.net/114530-bitbtn-icon-bei-onmouseleave-wieder-das-altes-bild-zurueck.html)

Delphiturbo 26. Mai 2008 23:48


BitBtn-Icon bei OnMouseLeave wieder das altes Bild zurück
 
Hallo,

Delphi-Quellcode:
procedure TForm1.BitBtn1CMMouseEnter(var Message: TMessage);
var
  ptWork : TPoint;
begin
  GetCursorPos(ptWork);
  if WindowFromPoint(ptWork) = BitBtn1.Handle then
  begin
    BitBtn1.Glyph := nil;
    ImageList1.GetBitmap(0, BitBtn1.Glyph);
  end;
  end;

procedure TForm1.BitBtn1CMMouseLeave(var Message: TMessage);
var
  ptWork : TPoint;
begin
  GetCursorPos(ptWork);
  if WindowFromPoint(ptWork) <> BitBtn1.Handle then
  begin
    BitBtn1.Glyph := nil;
    ImageList1.GetBitmap(1, BitBtn1.Glyph); // ok aber möchte ich das Icon vor OnMouseEnter wieder zurücksetzen !?
  end;

end;
Ist das möglich ?

rotfc 27. Mai 2008 03:51

Re: BitBtn-Icon bei OnMouseLeave wieder das altes Bild zurüc
 
Zitat:

Zitat von Delphiturbo
Ist das möglich ?

Müsste man vielleicht mal ausprobieren, oder?

Hast Du es schon ausprobiert? Warum sollten wir es vor Dir ausprobieren, bevor Du es versucht hast?

Google mal nach "rollover" oder wie diese Javascripts heißen, die Du in einem Delphiprogramm wohl haben willst.

Matze 27. Mai 2008 05:35

Re: BitBtn-Icon bei OnMouseLeave wieder das altes Bild zurüc
 
Hallo,

das gehört erstens in deinen anderen Thread: BitBtn Button effekt und zweitens steht dort eigentlich alles. Dass das Ursprungsbild auch in die ImageList muss, sollte klar sein.

Ich schließe hier mal. Weitere Fragen, nachdem du es selbst versucht hast (!), bitte im verlinkten Thema von dir.

G E S C H L O S S E N


Alle Zeitangaben in WEZ +1. Es ist jetzt 13:45 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz