BringToFront (C++)

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 include Unit2.h in this module.

Code

#include "Unit2.h"

void __fastcall TForm1::ShowPaletteButtonClick(TObject *Sender)
{
  if (!Form2->Visible)
  {
    Form2->Visible = true;
    Form2->BringToFront();
  }
}

Uses

Personal tools
Assistance