Hi!
Running Fedora 40 with Lazarus 3.6 (rev Unknown) FPC 3.2.2 x86_64-linux-gtk2
(from Fedora packet manager)
I have routine to change form's font (name/size). Recently I added new block for TPageControl fomt change by just copying a previous block and change "TPageControl" to "TBitBtn"
What is wrong with this that I can not see ?
procedure TdmUtils.LoadFontSettings(aForm: TForm);
......
......
if (aForm.Components[i] is TRadioButton) then
begin
(aForm.Components[i] as TRadioButton).Font.Name := fButtons;
(aForm.Components[i] as TRadioButton).Font.Size := fbSize
end;
if (aForm.Components[i] is TBitBtn) then
begin
(aForm.Components[i] as TBitBtn).Font.Name := fButtons;
(aForm.Components[i] as TBitBtn).Font.Size := fbSize
end;
if (aForm.Components[i] is TPageControl) then
begin
(aForm.Components[i] as TPageControl).Font.Name := fButtons;
(aForm.Components[i] as TPageControl).Font.Size := fbSize
end;
When compiled I get:
dUtils.pas(2001,32) Error: Identifier not found "TPageControl"
dUtils.pas(2003,31) Error: Identifier not found "TPageControl"
dUtils.pas(2004,31) Error: Identifier not found "TPageControl"
How ever I can select (from Object inspector) a component:
pgPreferences:TPageControl
and it has a property "Font" and subProperty "Size"
or write:
aForm.Components.TPageControl.Font.Size
every time I write dot it offers the next one in list, so it must know what is TPageControl
So from where comes: Identifier not found "TPageControl" ????
---------
P.S. the idea was to change text in Tab sheet (header). If I replace "TPageControl" with "TTabSheet" the result is same error:Error: Identifier not found "TTabSheet"