/*
SimplePanel, SimpleText, Add example
This example requires no additional controls.  All controls are created dynamically within the form's OnCreate event handler.
Note: Be sure to add #include <ComCtrls.hpp>
*/
void __fastcall TForm1::FormCreate(TObject *Sender)
{
  TStatusBar *pStatus = new TStatusBar(this);
  // Display the StatusBar control on the surface
  // of the form.
  pStatus->Parent = this;
  // Allow a single line of text -- no panels.
  PStatus->SimplePanel = true;
  // Provide sample text.
  // Create a new instance of TRichEdit, set its
  // properties, and display on the form.
  TRichEdit *pRich = new TRichEdit(this);
  // Display the RichEdit control on the surface
  // of the form.
  pRich->Parent = this;
  // The RichText control takes all space left
  // over from the StatusBar.
  pRich->Align = alClient;
  // Add 50 lines to the RichText
  for (int i = 1; i <= 50; i++)
    pRich->Lines->Add(AnsiString("This is line ") + IntToStr(i));
  pRich->SelStart = 0; // set text cursor to first character
  pStatus->SimpleText = IntToStr(pRich->Lines->Count) + " Lines loaded";
} 
