Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Win32/Win64 API (native code) (https://www.delphipraxis.net/17-win32-win64-api-native-code/)
-   -   Delphi Shape (https://www.delphipraxis.net/92028-shape.html)

poterp 13. Mai 2007 16:29


Shape
 
Hallo Experte,
ich versuche mit Hilfe von "Shape", ein Rectangle auf eine Form zu zeichnen mit folgenden Code:
Delphi-Quellcode:
procedure Tformimview.Shape1MouseMove(Sender: TObject; Shift: TShiftState;
  X, Y: Integer);
begin
if(X >= formimview.Shape1.Width - (1)) or (Y >= formimview.Shape1.Height - (1)) then
begin
shape1.Pen.Color:= $00A900E7;
Cursor:= crHSplit;
AuthorizedReSize:= True;
end
else
begin
Shape1.Pen.Color := clBlack;
Cursor := crDefault;
AuthorizedReSize:= false;

end;
if(AuthorizedReSize) then
begin
shape1.Width := Shape1.Width + (X)-(wX);
Shape1.Height := Shape1.Height + (X)- (yH);
end;
end;

procedure Tformimview.Shape1MouseDown(Sender: TObject;
  Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
wX:= X;
yH := Y;
end;
Es funktioniert nicht, wie es sein sollte. Wenn ich mit der Mause drauf gehe, geht das Rectangle unkontrolliert in der Height bzw. in der Width.

Meine Frage ist:
wie Kann ich mit der Mause definieren, bis welche Height bzw Width das Rectangle gehen kann.

mfg
poter


Alle Zeitangaben in WEZ +1. Es ist jetzt 09:07 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