Number of created forms?

Hello,

does anyone know how can i get number of created forms in the App? For example, if i have 5 forms in my application, but i autocreate at startup only two, i would like to get this number programaticly.  

Thanks
kzdownAsked:
Who is Participating?
 
ziolkoConnect With a Mentor Commented:
this way you can count all created forms:
procedure TForm1.Button5Click(Sender: TObject);
var i: Integer;
    fcount: Integer;
begin
  fcount := 0;
  for i := 0 to Application.ComponentCount - 1 do
    if Application.Components[i] is TForm then
      Inc(fcount);
end;


to get number of autocreate forms... don't think it's possible autocreate form is delphi IDE property and You can get this value in runtime

ziolko.
0
 
ThievingSixCommented:
Well, to get the ones auto created you could just look at the project source(Menu Project --> View Source). Anything with a Application.CreateForm(xxx) is an "auto created form". You can just put a variable increment if you really need too..
0
All Courses

From novice to tech pro — start learning today.