Ver Mensaje Individual
  #5  
Antiguo 06-01-2014
Avatar de ecfisa
ecfisa ecfisa is offline
Moderador
 
Registrado: dic 2005
Ubicación: Tres Arroyos, Argentina
Posts: 10.508
Reputación: 36
ecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to behold
Cita:
Empezado por ralmic Ver Mensaje
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
__________________
Daniel Didriksen

Guía de estilo - Uso de las etiquetas - La otra guía de estilo ....
Responder Con Cita