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

#include <vcl.h>
#pragma hdrstop

#include "RadioGroupItems.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
	: TForm(Owner)
{
}
//---------------------------------------------------------------------------
// BeginExample: RadioGroupItems
// Property: ExtCtrls.TCustomRadioGroup.Items
// Property: ExtCtrls.TCustomRadioGroup.ItemIndex
// Property: StdCtrls.TScrollBar.Kind

// BeginCode
/*
This example uses a radio group box and a scroll bar on a
form. When the user selects one of the radio buttons, the
scroll bar changes orientation accordingly.
*/
void __fastcall TForm1::FormCreate(TObject *Sender)
{
  RadioGroup1->Items->Add("Vertical");
  RadioGroup1->Items->Add("Horizontal");
  RadioGroup1->ItemIndex = 2;
}

void __fastcall TForm1::RadioGroup1Click(TObject *Sender)
{
  if (RadioGroup1->Items->Strings[RadioGroup1->ItemIndex] == "Vertical")
    ScrollBar1->Kind = sbVertical;
  else if (RadioGroup1->Items->Strings[RadioGroup1->ItemIndex] == "Horizontal")
    ScrollBar1->Kind = sbHorizontal;
}
// EndCode
// EndExample: RadioGroupItems
//---------------------------------------------------------------------------
