Recent

Author Topic: [SOLVED] Z-order is not respected as expected.  (Read 205 times)

Aruna

  • Hero Member
  • *****
  • Posts: 673
[SOLVED] Z-order is not respected as expected.
« on: June 20, 2025, 01:28:58 pm »
In the attached screenshot, you can see that the "Powered by Lazarus" logo is selected, indicating that it is an active and visible component on the form. However, despite this, it is being rendered beneath the TMemo control. Attempts to adjust the Z-order, such as using BringToFront or modifying the control order in the form designer, have no effect. The expected behavior is for the logo to appear on top, but the Z-order is not being respected in this case.

I found a fix by using a panel then inserting a TImage inside the panel but I would still like to know if this is a bug or normal behavior please? In my setup Z-order does not seem to work at all for any component.

I am using Linux Debian and Lazarus 4.00.
« Last Edit: June 20, 2025, 02:08:43 pm by Aruna »

alpine

  • Hero Member
  • *****
  • Posts: 1394
Re: Z-order is not respected as expected.
« Reply #1 on: June 20, 2025, 01:52:46 pm »
TImage is TGraphicControl, not TWinControl. It doesn't have a handle and it uses the one of its parent. Z-order is respected between the widgetset windows. That is why you must put it on a TPanel.
"I'm sorry Dave, I'm afraid I can't do that."
—HAL 9000

Aruna

  • Hero Member
  • *****
  • Posts: 673
Re: Z-order is not respected as expected.
« Reply #2 on: June 20, 2025, 01:59:22 pm »
TImage is TGraphicControl, not TWinControl. It doesn't have a handle and it uses the one of its parent. Z-order is respected between the widgetset windows. That is why you must put it on a TPanel.
Ah, no wonder that makes a lot of sense. Thank you @alpine.

 

TinyPortal © 2005-2018