RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TScreen.CustomFormCount Property

Indicates the number of forms or property pages displayed on the screen.

Pascal
property CustomFormCount: Integer;
C++
__property int CustomFormCount;

Read CustomFormCount to learn the number of forms or property pages currently displayed on the screen. These forms can be accessed by the CustomForms property. CustomFormCount can be used with CustomForms to iterate over all the forms and property pages in an application.  

C++ Examples: 

 

/*
The following code adds the name of all forms and dialogs on
the screen to ListBox1 when Button1 is clicked.
*/
void __fastcall TForm1::Button1Click(TObject *Sender)
{
  for (int i = 0; i < Screen->CustomFormCount; i++)
    ListBox1->Items->Add(Screen->CustomForms[i]->Name);
}

 

Delphi Examples: 

{
The following code adds the name of all forms and dialogs on
the screen to ListBox1 when Button1 is clicked.
} 
procedure TForm1.Button1Click(Sender: TObject);
var
  I: Integer;
begin
  for I := 0 to Screen.CustomFormCount-1 do
    ListBox1.Items.Add(Screen.CustomForms[I].Name);
end;

 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!