Autor Beitrag
jjturbo
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 516

Win2000 prof., WinXP prof.
D4 Stand., D5 Prof, D7 Prof, D2007 Prof.
BeitragVerfasst: Do 11.12.08 09:26 
Moin Forum,

wie kann man einfach abfragen, an welcher Seite die Maus ein TPanel verläßt?

Gruß jjturbo

_________________
Windows XP: Für die einen nur ein Betriebssystem - für die anderen der längste Virus der Welt...
DeddyH
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Do 11.12.08 09:43 
Evtl. so:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
var p: TPoint;
begin
  p := Panel.ScreenToClient(Mouse.CursorPos);
  if p.X < 0 then
    ShowMessage('Links')
  else if p.X > Panel.Width then
    ShowMessage('Rechts')
  else if p.Y < 0 then
    ShowMessage('Oben')
  else
    ShowMessage('Unten');
end;


Zuletzt bearbeitet von DeddyH am Do 11.12.08 10:11, insgesamt 1-mal bearbeitet
zuma
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 660
Erhaltene Danke: 21

Win XP, Win7, Win 8
D7 Enterprise, Delphi XE, Interbase (5 - XE)
BeitragVerfasst: Do 11.12.08 09:45 
mal so aus der Hüfte geschossen:

links: Mousepos < panel.left

rechts: mousepos > (panel.left + Panel.width)

analog für oben, unten (top, height statt left, width).

ups, zu langsam ;)

_________________
Ich habe nichts gegen Fremde. Aber diese Fremden sind nicht von hier! (Methusalix)
Warum sich Sorgen ums Leben machen? Keiner überlebts!
jjturbo Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 516

Win2000 prof., WinXP prof.
D4 Stand., D5 Prof, D7 Prof, D2007 Prof.
BeitragVerfasst: Do 11.12.08 10:01 
Jepp, danke :)

_________________
Windows XP: Für die einen nur ein Betriebssystem - für die anderen der längste Virus der Welt...