Delphi-PRAXiS
Seite 1 von 2  1 2      

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Sonstige Fragen zu Delphi (https://www.delphipraxis.net/19-sonstige-fragen-zu-delphi/)
-   -   Delphi How to prevent window title bar height changes when app is maximized (https://www.delphipraxis.net/210915-how-prevent-window-title-bar-height-changes-when-app-maximized.html)

jimsweb 29. Jun 2022 05:32


How to prevent window title bar height changes when app is maximized
 
I created a demo app in Delphi 11.1 and when I maximize the window, the title bar height gets re-sized (squeezed). It seems like windows' default behavior. How do I prevent it? I just wanted to keep the same title bar height even after the window is maximized.

Window not maximized:
https://ibb.co/sJpnPSH

Window maximized and title bar height is automatically reduced!! Is there a way to prevent this behavior?
https://ibb.co/Y86p4b9

can someone please advise me - how do we prevent this behavior? I just want to keep the title bar width without getting it changed.

haentschman 29. Jun 2022 06:16

AW: How to prevent window title bar height changes when app is maximized
 
Hi...8-)

Welcome...:dp:
This forum is in german language...
There are an english Version of the DelphiPraxis. https://en.delphipraxis.net :zwinker:
There you will be better helped...because they understand you. :zwinker:

:wink:

Sinspin 29. Jun 2022 07:55

AW: How to prevent window title bar height changes when app is maximized
 
Hey,

I don't think that you can prevent that, it's a Windows behaviour.
If you look for a workaround, one solution would be to align your client area to top or the bottom of the form to make sure the gap is not interfering. (Top align is the default behaviour)
Or, you draw the whole content by yourself, inclusive the window title bar.

Der schöne Günther 29. Jun 2022 09:33

AW: How to prevent window title bar height changes when app is maximized
 
Microsoft Teams is a good example - The electron app paints the title bar entirely by itself, and its size doesn't change, no matter if the window is maximized or not. It looks entirely out of place, I hate it with a passion.

Visual Studio Code is exactly the same, but at least it doesn't look like a children's playground.

jimsweb 29. Jun 2022 14:51

AW: How to prevent window title bar height changes when app is maximized
 
Zitat:

Zitat von haentschman (Beitrag 1508077)
Hi...8-)

Welcome...:dp:
This forum is in german language...
There are an english Version of the DelphiPraxis. https://en.delphipraxis.net :zwinker:
There you will be better helped...because they understand you. :zwinker:

:wink:

thank you and apologize for posting in German forum..

Unfortunately, it doesn't allow me to login/regiter in the english forum.. it says, i have an active user id /password in German forum.. but when i try to use my existing credentials, it doesn't allow me to login not sure how can i fix this..

jimsweb 29. Jun 2022 14:59

AW: How to prevent window title bar height changes when app is maximized
 
Zitat:

Zitat von Sinspin (Beitrag 1508078)
Hey,

I don't think that you can prevent that, it's a Windows behavior.
If you look for a workaround, one solution would be to align your client area to top or the bottom of the form to make sure the gap is not interfering. (Top align is the default behavior)
Or, you draw the whole content by yourself, inclusive the window title bar.

I apologize for not following this - how do I manually align client area to maintain the titlebar height? Can you please elaborate?

haentschman 29. Jun 2022 15:41

AW: How to prevent window title bar height changes when app is maximized
 
You don't need to apologize....:wink:
Zitat:

but when i try to use my existing credentials, it doesn't allow me to login not sure how can i fix this..
:gruebel:
I think, you schould write a PM to @Daniel (Admin) ... he can help you.

:wink:

Sinspin 29. Jun 2022 15:58

AW: How to prevent window title bar height changes when app is maximized
 
The idea was just to ignore the size change and make sure the client area stays at the same location. But, that idea went too short for been practicable :oops:
However, maybe would it be a better solution to wait until the program gets maximized,
then capture the form location and size, set the WindowState of the form back to normal and set the window location and size by youself.
Then will the title bar not change in size.

himitsu 29. Jun 2022 16:15

AW: How to prevent window title bar height changes when app is maximized
 
You could catch the WM_MAXIMIZE event and not let your program maximize itself.
Instead, you just set the window coordinates so that it is maximally large, but still has the NORMAL status.

KodeZwerg 29. Jun 2022 16:34

AW: How to prevent window title bar height changes when app is maximized
 
Three options you have that work for me.
1. Create a borderless window and code your own caption
2. Overwrite the maximize method
3. Use Styles


Alle Zeitangaben in WEZ +1. Es ist jetzt 14:33 Uhr.
Seite 1 von 2  1 2      

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