Lazarus

Programming => LCL => Topic started by: lander on October 16, 2021, 03:30:27 pm

Title: 1° position but label keep to be behind component
Post by: lander on October 16, 2021, 03:30:27 pm
I placed a TreeView. If I put a label on top of the TreeView the text is white, if I move that to the Form it is black. I have changed position to be top level but it keep to be white on the TreeView.
If I move the TreeView I see the Label behind...
Title: Re: 1° position but label keep to be behind component
Post by: wp on October 16, 2021, 03:39:13 pm
Read https://forum.lazarus.freepascal.org/index.php/topic,37185.msg249104.html#msg249104

Use a TStaticText rather than a TLabel.
Title: Re: 1° position but label keep to be behind component
Post by: lander on October 16, 2021, 05:22:09 pm
Thank you wp.
Title: Re: 1° position but label keep to be behind component
Post by: lander on October 17, 2021, 10:34:14 am
There's a new problem. To have Default color on the page control, where the TreeView is placed, I applied this (https://forum.lazarus.freepascal.org/index.php/topic,18345.msg134950.html#msg134950) code to my form.
After this the StaticText appear as the attached image and if I change the color or flag to TRUE the parent control it doesn't fix.
Title: Re: 1° position but label keep to be behind component
Post by: wp on October 17, 2021, 11:38:08 am
Code: Pascal  [Select][+][-]
  1. procedure TForm1.FormCreate(Sender: TObject);
  2. begin
  3.   FixPageControl(PageControl1);
  4.   StaticText1.Color := TreeView1.Color;
  5.   StaticText1.Transparent := false;
  6. end;
Title: Re: 1° position but label keep to be behind component
Post by: lander on October 17, 2021, 12:20:23 pm
wp you are a genius. Thanks again.
TinyPortal © 2005-2018