Lazarus
Using the Lazarus IDE => Designer => Topic started by: heebiejeebies on June 02, 2021, 08:53:19 am
-
Hi all,
My app consists of a large number of screens, which the user can flick between using a PageControl. At times I will need to display a banner at the top of the screen that covers the page beneath it, regardless of which tab the user is on. I have tried making a banner out of a TStaticText and a TLabel and moving them to the front of the Z-order. Nothing doing - it covers the tabs of the PageControl, but not the content of the individual page. :( The banner is a child of the form, of course - not of the Pagecontrol.
How do I get it to properly respect the Z-order and show the banner in front of everything at all times?
Thanks!
-
TLabel is inherited from TGraphicControl, so you cannot change the Z order, which only works for TWinControls. As an alternative solution, put the label inside a panel then:
XY.SendToBack;
Panel.BringToFront;
-
Use a TNotebook which covers the entire form. Add two pages. The first page contains the pagecontrol and the rest, the second page contains the banner. When you want to show the banner, set Notebook.Pageindex to 1 (the index of the banner), when you want to hide it reset the PageIndex back 0. Use the object tree above the object inspector to navigate between the notebook pages.
-
TLabel is inherited from TGraphicControl, so you cannot change the Z order, which only works for TWinControls. As an alternative solution, put the label inside a panel then:
XY.SendToBack;
Panel.BringToFront;
Thank you. It didn't work. Same result - it still only covers the tabs, not the content. :(
-
Use a TNotebook which covers the entire form. Add two pages. The first page contains the pagecontrol and the rest, the second page contains the banner. When you want to show the banner, set Notebook.Pageindex to 1 (the index of the banner), when you want to hide it reset the PageIndex back 0. Use the object tree above the object inspector to navigate between the notebook pages.
Thank you! But surely that will mean I see nothing but the banner when I set the notebook to 1?
-
Should I submit a bug report for this?
-
Should I submit a bug report for this?
I'm not sure it's a bug(maybe it is), but even if you create a bug report, you must attach a project where the issue is clearly reproducible. So perhaps you can start here with a test project?