7. Métodos de los formularios
Los formularios también son componentes y como tales disponen de métodos, algunos son comunes a los del resto de los componentes, pero otros son particulares para los formularios. En este apartado se detallan los más importantes.
7.1. En TForm
~Tform()
Destructor.
ArrangeIcons()
Ordena los iconos de todas las ventanas MDI hijas secundarias en la ventana MDI primária.
void __fastcall ArrangeIcons(void);
This code runs when the user chooses a menu item called Window|Arrange Icons:
void __fastcall TForm1::ArrangeIcons1Click(TObject *Sender)
{
Form1->ArrangeIcons();
}
Cascade()
Ordena en cascada todas las ventanas MDI hijas que no están minimizadas.
void __fastcall Cascade(void);
This code arranges all MDI children of the current MDI parent form in a cascade pattern when the user chooses the Cascade menu command:
void __fastcall TForm1::Cascade1Click(TObject *Sender)
{
Cascade();
}
Next()
Activa y coloca en primer plano la siguiente MDI secundaria disponible en la lista de ventanas.
void __fastcall Next(void);
The following code activates the next child of Form1.
Form1->Next();
Previous()
Activa y coloca en primer plano la anterior MDI secundaria disponible en la lista de ventanas.
void __fastcall Previous(void);
This code sample activates the previous child window of the parent (Form1) when the user selects a menu item named Previous on a menu.
void __fastcall TForm1::PreviousClick(TObject *Sender)
{
Previous();
}
TForm()
Constructor.
Tile()
Organiza en mosaico todas las ventanas MDI secundarias que no están minimizadas.
void __fastcall Tile(void);
This example uses three forms. The first form has its FormStyle property set to MDIForm. The other two have their FormStyle properties set to MDIChild and their Visible properties set to True. Add a main menu component and name one of the menu items TileForms. This is code for the TileFormsClick handler:
void __fastcall TForm1::TileFormsClick(TObject *Sender)
{
TileMode = tbVertical;
Tile();
}