RAD Studio VCL Reference
|
Puts the control in front of all other controls in its parent control.
procedure BringToFront;
__fastcall BringToFront();
Call BringToFront to ensure that a form is visible or to reorder overlapping controls within a form.
Note that controls that wrap Windows screen objects (control classes descended from TWinControl) always "stack" above lightweight controls (control classes descended from TGraphicControl). BringToFront can force a lightweight control, such as a Shape, to stack above other lightweight controls, but wrapped controls, such as an Edit, will still stack above the Shape.
Without BringToFront, controls are stacked in their order they were placed on the form.
C++ Examples:
/* The following code uses two forms. Form1 has a button on it. The second form is used as a tool palette. This code makes the palette form visible, and ensures it is the top form by bringing it to the front. To run this example, you must include Unit2.h in this module. */ #include "Unit2.h" void __fastcall TForm1::ShowPaletteButtonClick(TObject *Sender) { if (!Form2->Visible) { Form2->Visible = true; Form2->BringToFront(); } }
Delphi Examples:
{ The following code uses two forms. Form1 has a button on it. The second form is used as a tool palette. This code makes the palette form visible, and ensures it is the top form by bringing it to the front. To run this example, you must add Unit2 in the uses clause of your unit. } procedure TForm1.ShowPaletteButtonClick(Sender: TObject); begin if Form2.Visible = False then Form2.Visible := True; Form2.BringToFront; end;
Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
|
What do you think about this topic? Send feedback!
|