RAD Studio VCL Reference
|
Lists all the forms and property pages that are currently displayed in the application.
property CustomForms [Index: Integer]: TCustomForm;
__property TCustomForm CustomForms[int Index];
Use CustomForms to access a form or property page by index. The value of Index is a number between zero (the first custom form) and CustomFormCount - 1. CustomForms can be used with CustomFormCount when an application needs to iterate over all its forms and property pages.
Unlike the Forms property, CustomForms lists TCustomForm descendants that do not derive from TForm (such as property pages).
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) 2008 CodeGear(TM). All Rights Reserved.
|
What do you think about this topic? Send feedback!
|