Autor Beitrag
Andre :-)
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 55



BeitragVerfasst: So 16.02.03 14:49 
Hallo,

ich kann ja bei einem Label das OnMouseMove Event zum wechseln der Farbe nutzen.
ausblenden Quelltext
1:
vg2Label2.Font.Color := clWhite;					

Nun muss ich anscheinend das selbe Event auch wieder zum verlassen nutzen?! Oder

Und wenn ja, wie kann ich dann prüfen ob die Mouse nicht mehr drauf zeigt. Ich habe zwar die X Y Koordinaten die ich nutzen könnte, aber mir fehlt da der Funken!

Danke

Moderiert von user profile iconTino: Absätze entfernt.

_________________
Security is just a feeling, but never reality
Christian S.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 20451
Erhaltene Danke: 2264

Win 10
C# (VS 2019)
BeitragVerfasst: So 16.02.03 14:56 
Kannst Du nicht die Events OnMouseEnter und OnMouseLeave verwenden? (bei D6 Pers gibt's die)

_________________
Zwei Worte werden Dir im Leben viele Türen öffnen - "ziehen" und "drücken".
D0P3 F!$H
Gast
Erhaltene Danke: 1



BeitragVerfasst: So 16.02.03 14:57 
Moin!

Probiers doch mal so:

ausblenden Quelltext
1:
2:
if (x < label.left) or (x>label.left + label.width) and (y < label.top) or (y > label.top + label.height) then {Farbe, wenn nicht drüber}
else {Farbe, wenn drüber}
Andre :-) Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 55



BeitragVerfasst: So 16.02.03 15:01 
Hi,

@Peter
Ich nutze eine vg2Label Komponente und da gibts leider nur
ein MouseMove Event. :cry:

@Dope
Werde ich gleich mal ausprobieren.

Danke

_________________
Security is just a feeling, but never reality
Andre :-) Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 55



BeitragVerfasst: So 16.02.03 15:38 
@Dope

nee ging leider nicht!
Er wechselte zwar die Farbe, aber nicht wieder zurück.

Danke

_________________
Security is just a feeling, but never reality
Christian S.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 20451
Erhaltene Danke: 2264

Win 10
C# (VS 2019)
BeitragVerfasst: So 16.02.03 15:54 
Dann schreib' in das OnMouseMove-Event des Labels: "Label1.Font.Color:=clRed" und in das OnMouseMove-Event der Form (oder was auch immer um das Label herum ist) "Label1.Font.Color:=clBlack". Mehr nicht.

MfG,
Peter

_________________
Zwei Worte werden Dir im Leben viele Türen öffnen - "ziehen" und "drücken".
D0P3 F!$H
Gast
Erhaltene Danke: 1



BeitragVerfasst: So 16.02.03 15:59 
Hast recht ... ich habs zwar nur mit einem normalen Label ausprobiert, aber auch dort klappt es nicht!

Beim ersten Mal hat er noch ab und zu die Farbe gwechselt, dann hab ich ein neues Programm gemacht und seitdem ändert der die Farbe nie mehr! *verzweifel*

Ist ja auch logisch, das meine Lösung nicht klappt, weil die Maus sich ja nicht über dem Label befindet, wenn die Schrift wieder normal werden soll. :roll:
Andre :-) Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 55



BeitragVerfasst: So 16.02.03 16:33 
@Peter:

Das geht, danke!!

_________________
Security is just a feeling, but never reality


Zuletzt bearbeitet von Andre :-) am So 16.02.03 16:34, insgesamt 1-mal bearbeitet
derDoc
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 623

Win Vista Prof
D2007 Prof
BeitragVerfasst: So 16.02.03 16:34 
Nur zum Verständnis.
Du willst die Farbe eines Labels ändern, wenn die die Maus bewegst, bzw. wenn du aufhörst soll die Ursprungsfarbe wieder hergestellt werden.
Oder willst du, sobald die Maus auf des Label bewegt wird, die Farbe ändern?

_________________
MfG derDoc
There are only 10 types of people: those who understand binary and those who don't.
Andre :-) Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 55



BeitragVerfasst: So 16.02.03 16:35 
Danke Alle,

hat sich erledigt!
Es funktioniert so, wie Peter es gesagt hat! :D

_________________
Security is just a feeling, but never reality
Shadowdragon
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 143

Win 2000
Delphi 6 Pers., Delphi 7
BeitragVerfasst: So 16.02.03 17:55 
Mach ich auch immer, is besser als so'n button :P

Bei Delphi 6 Personal gibt's n OnMouseLeave??

Hab ich garnet gewusst! *lol*

Danke!

_________________
Ein Programm gleicht dem Prinzip von Jenga:
Viele Bestandteile, wird nach oben hin immer besser, nach unten hin immer instabiler und wenn man was falsch macht klappt der ganze Mist zusammen.