Roberto Colpani 0 Posted May 13, 2022 Hi, I have this little problem: when I want to maximize my application the height don't care of the main task bar of windows; the height of my application is the height of the screen including the task bar. Anyone have this problem or anyone know how to fix it? Thanks. Share this post Link to post
Fons N 17 Posted May 13, 2022 Hi Roberto, In the OnConstrainedResize event of the Form include the following: MaxHeight:= Screen.WorkAreaHeight; MaxWidth:= Screen.WorkAreaWidth; This works for me. I have only 1 monitor, so I don't know how well it works in a multiple monitor setup. Greetings, Fons Share this post Link to post
David Heffernan 2354 Posted May 14, 2022 23 hours ago, Fons N said: Hi Roberto, In the OnConstrainedResize event of the Form include the following: MaxHeight:= Screen.WorkAreaHeight; MaxWidth:= Screen.WorkAreaWidth; This works for me. I have only 1 monitor, so I don't know how well it works in a multiple monitor setup. Greetings, Fons This should not be necessary. It also seems like there would be scenarios which this would stop the user doing things they want to do. Share this post Link to post
David Heffernan 2354 Posted May 14, 2022 On 5/13/2022 at 9:17 AM, Roberto Colpani said: Hi, I have this little problem: when I want to maximize my application the height don't care of the main task bar of windows; the height of my application is the height of the screen including the task bar. Anyone have this problem or anyone know how to fix it? Thanks. Does this happen with a brand new VCL app with a single form that does nothing? If not then the answer is specific to your code. Share this post Link to post
Fons N 17 Posted May 14, 2022 (edited) 4 hours ago, David Heffernan said: This should not be necessary. It also seems like there would be scenarios which this would stop the user doing things they want to do. Hi David, With a vanilla VCL application it is not required. I use the TMS FNC Ribbon and when maximized it covers the Windows task bar. In the Delphi Designer it looks like this. When I run the application it looks like this. This is right after using the New Item template which creates a new application and form. I did not change a single thing. Unfortunately, when maximized it covers the Windows task bar. Programming is just a hobby for me, though I do make application that are used at work (my job however has nothing to do with programming). The easiest way to fix it, was using the OnConstrainedResize event. I am not a bad Delphi programmer, just as long as it is standard Delphi code and not all kinds of trickery with Windows handles and such things. I will report this to TMS Software. For the record, I use Delphi Pro 11.1 with patch 1. My simple solution for now works with 1 monitor. At work we use 2 or more. My solution probably has unwanted effects when using a multiple monitor setup. Not sure, but probably. So, unless TMS fixes this, I will need some kind of workaround. The last resort option is to prevent the application from maximizing. Greetings, Fons Edited May 14, 2022 by Fons N Share this post Link to post
Fons N 17 Posted May 18, 2022 On 5/14/2022 at 10:34 AM, David Heffernan said: This should not be necessary. Hi David, I reported it to TMS. They provided a solution. However, I finally decided to base my main form on the standard TForm and not TTMSFNCRibbonForm. This of course had some impact on the visual side of how the form looks, but I am okay with the end result. Now, maximizing the form works as excepted without any tinkering. Also, as a benefit when the user changes the width of the form with the mouse, the ribbon does not flicker anymore. Greetings, Fons Share this post Link to post
Hans J. Ellingsgaard 21 Posted June 1, 2022 On 5/13/2022 at 10:26 AM, Fons N said: In the OnConstrainedResize event of the Form include the following: MaxHeight:= Screen.WorkAreaHeight; MaxWidth:= Screen.WorkAreaWidth; You could use the Constraints property of the form instead of using the Event. Self.Constraints.MaxHeight := Screen.WorkAreaHeight; Self.Constraints.MaxWidth := Screen.WorkAreaWidth; 1 Share this post Link to post