Cita:
Empezado por ralmic
tengo 3 tedit y quiero a agregarlos a 3 columnas de un stringgrid y asi sucesivamente cuando le de click al boton pase a la siguiente fila y los agregue
|
Hola ralmic.
Código:
void __fastcall TForm1::Button1Click(TObject *Sender)
{
TStringGrid *sg = static_cast<TStringGrid*>(StringGrid1);
static int CurrentRow = sg->FixedRows;
if (CurrentRow < sg->RowCount) {
sg->Cells[sg->FixedCols][CurrentRow] = Edit1->Text;
sg->Cells[sg->FixedCols+1][CurrentRow] = Edit2->Text;
sg->Cells[sg->FixedCols+2][CurrentRow] = Edit3->Text;
CurrentRow++;
}
}
Saludos