//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::FormCreate(TObject *Sender)
{
StringGrid1->Cells[0][0] = "Nombre";
StringGrid1->Cells[1][0] = "Apellido";
StringGrid1->Cells[2][0] = "Sexor";
StringGrid1->Cells[3][0] = "Estado civil";
StringGrid1->Cells[4][0] = "Email";
StringGrid1->Cells[5][0] = "Fono P.";
StringGrid1->Cells[6][0] = "Celular";
StringGrid1->Cells[7][0] = "Otro";
}
//---------------------------------------------------------------------------
void __fastcall TForm1::StringGrid1Click(TObject *Sender)
{
if( StringGrid1->Col == 3 )
{
TRect Recto = StringGrid1->CellRect(StringGrid1->Col, StringGrid1->Row);
ComboBox1->Top = StringGrid1->Top;
ComboBox1->Left = StringGrid1->Left;
ComboBox1->Top = ComboBox1->Top + Recto.Top + StringGrid1->GridLineWidth;
ComboBox1->Left = ComboBox1->Left + Recto.Left + StringGrid1->GridLineWidth + 1;
ComboBox1->Height = (Recto.Bottom - Recto.Top) + 1;
ComboBox1->Width = Recto.Right - Recto.Left;
ComboBox1->Visible = True;
}
else
ComboBox1->Visible = False;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::ComboBox1Change(TObject *Sender)
{
StringGrid1->Cells[StringGrid1->Col][StringGrid1->Row] =
ComboBox1->Items->Strings[ComboBox1->ItemIndex];
}
//---------------------------------------------------------------------------