Einzelnen Beitrag anzeigen

Aboz1

Registriert seit: 17. Mai 2013
8 Beiträge
 
#7

AW: Shape soll Form nicht überschreitten.

  Alt 21. Jun 2013, 16:29
Du hast doch einfach 2 Randbedingungen die zu behandeln sind.
Es klappt,tausend Dank. So sieht mein Quelltext aus
Delphi-Quellcode:
procedure TForm1.FormMouseMove(Sender: TObject; Shift: TShiftState; X,
  Y: Integer);
begin

shape1.top:= screentoclient (mouse.CursorPos).Y - shape1.Height div 2;
if mouse.cursorpos.y < Form1.top then
  Shape1.top := 0
else
if mouse.cursorpos.y > Form1.top + Form1.clientheight-Shape1.height then
  shape1.top := Form1.clientheight-Shape1.height
else
  shape1.top := mouse.CursorPos.y-Form1.top;

end;
Für die untere Kante jedenfalls. Die Maus ist jetzt komischerweise ein Stück über dem Shape. Das heisst, wenn ich sie hochziehe, kommt das Shape nie ganz oben an, da die Maus die Form verlässt.

Habs jetzt. Vielen Dank nochmal.

Geändert von Aboz1 (21. Jun 2013 um 18:16 Uhr)
  Mit Zitat antworten Zitat