Forum > Designer

Z-order won't play nicely with PageControl

(1/2) > >>

heebiejeebies:
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!

balazsszekely:
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:

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---XY.SendToBack;Panel.BringToFront; 

wp:
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.

heebiejeebies:

--- Quote from: GetMem on June 02, 2021, 02:54:46 pm ---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:

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---XY.SendToBack;Panel.BringToFront;

--- End quote ---

Thank you.  It didn't work.  Same result - it still only covers the tabs, not the content.  :(

heebiejeebies:

--- Quote from: wp on June 02, 2021, 03:00:39 pm ---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.

--- End quote ---

Thank you!  But surely that will mean I see nothing but the banner when I set the notebook to 1?

Navigation

[0] Message Index

[#] Next page

Go to full version