AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Sprachen und Entwicklungsumgebungen Sonstige Fragen zu Delphi Delphi How to prevent window title bar height changes when app is maximized
Thema durchsuchen
Ansicht
Themen-Optionen

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

Ein Thema von jimsweb · begonnen am 29. Jun 2022 · letzter Beitrag vom 30. Jun 2022
Antwort Antwort
Seite 1 von 2  1 2      
jimsweb

Registriert seit: 30. Mai 2013
5 Beiträge
 
#1

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

  Alt 29. Jun 2022, 05:32
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.

Geändert von jimsweb (29. Jun 2022 um 05:48 Uhr)
  Mit Zitat antworten Zitat
Benutzerbild von haentschman
haentschman

Registriert seit: 24. Okt 2006
Ort: Seifhennersdorf / Sachsen
5.292 Beiträge
 
Delphi 12 Athens
 
#2

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

  Alt 29. Jun 2022, 06:16
Hi...

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

  Mit Zitat antworten Zitat
Benutzerbild von Sinspin
Sinspin

Registriert seit: 15. Sep 2008
Ort: Dubai
615 Beiträge
 
Delphi 10.3 Rio
 
#3

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

  Alt 29. Jun 2022, 07:55
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.
Stefan
Nur die Besten sterben jung
A constant is a constant until it change.
  Mit Zitat antworten Zitat
Der schöne Günther

Registriert seit: 6. Mär 2013
6.110 Beiträge
 
Delphi 10 Seattle Enterprise
 
#4

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

  Alt 29. Jun 2022, 09:33
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.
  Mit Zitat antworten Zitat
jimsweb

Registriert seit: 30. Mai 2013
5 Beiträge
 
#5

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

  Alt 29. Jun 2022, 14:51
Hi...

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

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..
  Mit Zitat antworten Zitat
jimsweb

Registriert seit: 30. Mai 2013
5 Beiträge
 
#6

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

  Alt 29. Jun 2022, 14:59
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?
  Mit Zitat antworten Zitat
Benutzerbild von haentschman
haentschman

Registriert seit: 24. Okt 2006
Ort: Seifhennersdorf / Sachsen
5.292 Beiträge
 
Delphi 12 Athens
 
#7

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

  Alt 29. Jun 2022, 15:41
You don't need to apologize....
Zitat:
but when i try to use my existing credentials, it doesn't allow me to login not sure how can i fix this..

I think, you schould write a PM to @Daniel (Admin) ... he can help you.

  Mit Zitat antworten Zitat
Benutzerbild von Sinspin
Sinspin

Registriert seit: 15. Sep 2008
Ort: Dubai
615 Beiträge
 
Delphi 10.3 Rio
 
#8

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

  Alt 29. Jun 2022, 15:58
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
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.
Stefan
Nur die Besten sterben jung
A constant is a constant until it change.
  Mit Zitat antworten Zitat
Benutzerbild von himitsu
himitsu

Registriert seit: 11. Okt 2003
Ort: Elbflorenz
43.139 Beiträge
 
Delphi 12 Athens
 
#9

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

  Alt 29. Jun 2022, 16:15
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.
Garbage Collector ... Delphianer erzeugen keinen Müll, also brauchen sie auch keinen Müllsucher.
my Delphi wish list : BugReports/FeatureRequests
  Mit Zitat antworten Zitat
Benutzerbild von KodeZwerg
KodeZwerg

Registriert seit: 1. Feb 2018
3.685 Beiträge
 
Delphi 11 Alexandria
 
#10

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

  Alt 29. Jun 2022, 16:34
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
Gruß vom KodeZwerg
  Mit Zitat antworten Zitat
Antwort Antwort
Seite 1 von 2  1 2      


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 23:20 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