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 Weißer Rand beim entfernen von WS_SIZEBOX (https://www.delphipraxis.net/101253-weisser-rand-beim-entfernen-von-ws_sizebox.html)

Neutral General 10. Okt 2007 13:22


Weißer Rand beim entfernen von WS_SIZEBOX
 
Liste der Anhänge anzeigen (Anzahl: 1)
Hi,

Ich ändere mit folgendem Code den Style eines Fensters.

Delphi-Quellcode:
procedure TNVCLForm.SetSizeable(const Value: Boolean);
var old: Cardinal;
begin
  old := GetWindowLong(FHandle,GWL_STYLE);
  if Value then
    SetWindowLong(FHandle,GWL_STYLE,old or WS_SIZEBOX)
  else
    SetWindowLong(FHandle,GWL_STYLE,old and not WS_SIZEBOX);
  FSizeable := Value;
end;
Wenn ich jetzt von mit-Sizebox auf ohne-Sizebox wechsele bekomme ich einen unschönen weißen Rand (Anhang). Was mach ich dagegen? (Hab den weißen Rand rot gefärbt damit man ihn besser erkennt)

Gruß
Neutral General

Neutral General 10. Okt 2007 13:46

Re: Weißer Rand beim entfernen von WS_SIZEBOX
 
Hi,

Hab ne Lösung gefunden.. Falls jemand das gleiche Problem hat:

Man muss nachdem man den Rahmen ändert folgendes aufrufen:

Delphi-Quellcode:
//                                                                         // !wichtig! // 
SetWindowPos(hwnd,0, 0, 0, 0, 0,SWP_NOZORDER or SWP_NOSIZE or SWP_NOMOVE or SWP_DRAWFRAME);
Gruß
Neutral General


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