Forum > Linux

Error: Identifier not found "TPageControl"[solved]

(1/1)

OH1KH:
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 ?


--- 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";}};} ---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"

Bart:
IIRC then TPageControl is defined in unit ComCtrls?
So you need to add that to your uses clause.

Bart

MarkMLl:

--- Quote from: Bart on November 11, 2024, 03:35:54 pm ---IIRC then TPageControl is defined in unit ComCtrls?
So you need to add that to your uses clause.

--- End quote ---

Give a man a fish...

If you go to the documentation at https://lazarus-ccr.sourceforge.io/docs/ then to LCL and Index (top-left), you can find the entry for TPageControl and it tells you what unit it's in (top-right).

MarkMLl

OH1KH:
Thanks for both!

Just what I though, I did not see that (did not understand to look at uses clause)

Navigation

[0] Message Index

Go to full version