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

#include <vcl.h>
#pragma hdrstop

#include "TAlignment.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
	: TForm(Owner)
{
}
//---------------------------------------------------------------------------

// BeginExample: TAlignment
// Property: ComCtrls.TParaAttributes.Alignment

// BeginCode
/*
To use this example, place a Toolbar and a RichEdit on the 
form. Right click the toolbar and select New Button three 
times.  Place the ToolButton1Click handling code in the on 
click event of the first TToolButton, then attach the same 
OnClick handler for each button.  Double click on the Image-
List to load the images.  Load in the order right, center
and left.  Name the Imagelist ToolbarImages.  Select the
Toolbar and set the Images property to ToolbarImages.  Then
select each ToolButton and set the ImageIndex property.
Selected lines on the RichEdit will be aligned when the tool
bar buttons are clicked.
*/
void __fastcall TForm1::ToolButton1Click(TObject *Sender)
{
  if (Sender == ToolButton1)
    RichEdit1->Paragraph->Alignment = taLeftJustify;
  else if (Sender == ToolButton2)
    RichEdit1->Paragraph->Alignment = taCenter;
  else if (Sender == ToolButton3)
	RichEdit1->Paragraph->Alignment = taRightJustify;
}
// EndCode
// EndExample: TAlignment
//---------------------------------------------------------------------------

