Hi, I have the following problem:
I'm trying to create a simple form at runtime where some are displayed TLabel
, and I need each one to be centered and at a certain height. I've been able to center them correctly using TLabel.Align := alClient
and TLabel.Alignment := taCenter
, but I can't get it to the height I need, because TLabel.Layout
it only lets me specify top, center, or bottom.
How can I assign TLabel
a height value like ClientHeight div 3
?
I have this code to create a label:
with TLabel.Create(Self) do
begin
Align := alClient;
Alignment := taCenter;
Top := (F.ClientHeight div 3) * 2;
caption:= 'Texto de la etiqueta';
Font.Size:= 18;
Font.Color := RGB(128, 0, 0);
Parent:= F;
end;
It seems that when applying Align
and Alignment
it ignores what I specify in Top
, then I don't know how to give it the desired value.
EDIT :
I am using Lazarus v1.6RC1
in Windows 10
. The app is also for Windows 10
.
Thanks in advance.