//---------------------------------------------------------------------------

#include <vcl.h>
#pragma hdrstop

#include "TStringsAssign.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
	: TForm(Owner)
{
}
//---------------------------------------------------------------------------
// BeginExample: TStringsAssign
// Method: Classes.TStrings.Assign
// Method: Classes.TStringList.Add

// BeginCode
/*
This example creates a stringlist, adds elements to it and
assigns the strings to items of a combo box.
*/

#include <memory>       //for STL auto_ptr class

void __fastcall TForm1::Button1Click(TObject *Sender)
{
  std::auto_ptr<TStrings> StringList(new TStringList());
  StringList->Add("This example uses A string List. ");
  StringList->Add("It is the easiest way to add strings");
  StringList->Add("to a combobox's list of strings. ");
  StringList->Add("Always remember TStrings is abstract,");
  StringList->Add("So create a TStringList instead.");
  ComboBox1->Width = 210;
  ComboBox1->Items->Assign(StringList.get());
  ComboBox1->ItemIndex = 0;
}
// EndCode
// EndExample: TStringsAssign
//---------------------------------------------------------------------------
