/*
TToolButton, TToolBar, StringList example
To use this example, create a new application and add the example code to the unit.
*/ 
#include <comctrls.hpp>
void AddButtons(TToolBar *pToolBar, TStringList *pCaptions)
{
  for (int i = 0; i < pCaptions->Count; i++)
  {
    TToolButton *pButton = new TToolButton(pToolBar);
    pButton->Parent = pToolBar;
    pButton->Caption = pCaptions->Strings[i];
    if (pButton->Caption == "|")
      pButton->Style = tbsSeparator;
    else
      pButton->Style = tbsButton;
  }
}

void __fastcall TForm1::FormCreate(TObject *Sender)
{
  TToolBar *pToolBar = new TToolBar(this);
  pToolBar->Parent = this;
  TStringList *pCaptions = new TStringList();
  pCaptions->Add("New");
  pCaptions->Add("Save");
  pCaptions->Add("|");
  pCaptions->Add("Cut");
  pCaptions->Add("Copy");
  pCaptions->Add("Paste");
  AddButtons(pToolBar, pCaptions);
  delete pCaptions;
  pToolBar->ShowCaptions = True;
  pToolBar->Height = 40;
}
 
