BringToFront (Delphi)

From RAD Studio Code Examples
Jump to: navigation, search

Description

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.

Code

procedure TForm1.ShowPaletteButtonClick(Sender: TObject);
begin
if Form2.Visible = False then Form2.Visible := True;
Form2.BringToFront;
end;

Uses