Forum > LCL

To count the amount of each control type

(1/1)

asdf:
In a form, there are lots of controls and various types.
Please help finding the way to count for each type :-[.
Thank you.

typo:

--- Code: ---  for i := 0 to Application.ComponentCount - 1 do
    if Application.Components[i] is TForm then
      Showmessage(TForm(Application.Components[i]).Name);
--- End code ---

A.S.:

--- Code: ---sl: TStringList;
...
sl.Clear;
for i := 0 to Components.Count - 1 do
  sl.Values(Components[i].ClassName) :=
    IntToStr(StrToIntDef(sl.Values(Components[i].ClassName), 0) + 1));

--- End code ---

Navigation

[0] Message Index

Go to full version