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

#include <vcl.h>
#pragma hdrstop

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

// BeginCode
/*
This example specifies an edit mask in a string grid to
limit the cells that contain telephone numbers, as indicated
by a label cell in the first row.  Include goEditing in the
TStringGrid Options property.  Set the title of one of the
columns to 'Phone Number'.  Set the DefaultColWidth large
enough to see a phone number.
*/
void __fastcall TForm1::FormCreate(TObject *Sender)
{
  StringGrid1->Cells[2][0] = "Phone Number";
}

void __fastcall TForm1::StringGrid1GetEditMask(TObject *Sender, int ACol, int ARow,
          UnicodeString &Value)
{
  if (StringGrid1->Cells[ACol][0] == "Phone Number")
	Value =  "!\(999\)000-0000;1";
}
// EndCode
// EndExample: OnGetEditMask
//---------------------------------------------------------------------------
