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 BorderColor eines TWinControl-Descendants ändern (https://www.delphipraxis.net/176598-bordercolor-eines-twincontrol-descendants-aendern.html)

Codehunter 16. Sep 2013 10:42

BorderColor eines TWinControl-Descendants ändern
 
Liste der Anhänge anzeigen (Anzahl: 1)
Moin!

Ich leite mir von TWinControl eine Klasse ab und verpasse der mit folgendem Code einen Rahmen:
Delphi-Quellcode:
procedure TmyClass.MakeBorder;
var
  Style: LongInt;
begin
  Style:= GetWindowLong(Self.Handle, GWL_STYLE);
  Self.BorderWidth:= 1;
  SetWindowLong(Self.Handle, GWL_STYLE, (Style or WS_BORDER));
end;
Die Prozedur wird über WndProc und WM_PAINT aufgerufen. Das funktioniert auch soweit. Nur dummerweise ist der Rahmen in einer extrem hellen Farbe, sodass er kaum auffällt (siehe Bild). Ein bisschen dunkler wäre gut, ein SubClassing von EDIT ideal. Nur wüßte ich im Moment nicht wie das machen ist.

Grüße
Cody


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

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