Ver Mensaje Individual
  #9  
Antiguo 30-11-2011
omarodalis omarodalis is offline
No confirmado
NULL
 
Registrado: oct 2011
Posts: 15
Reputación: 0
omarodalis Va por buen camino
Red face una duda...

disculpa ecfisa, solo queria preguntarte como creo un metodo aparte que me cree los Edits en tiempo real, por ejemplo:

void crearEdits(int cantidad){

for(int i=0;i <cantidad; i++)
{
TEdit *TE = new TEdit(this);
TE->Left = 8;
TE->Height = 25;
TE->Width = 100;
TE->Top = i* 45 + TE->Height;
TE->Name = "Edit" + IntToStr(i+1);
TE->Parent = this; // o InsertControl(TE);
}
}


/// Y después mandarlos a llamar al hacer clic en un boton por ejemplo... yo hago eso pero me marca este error
[BCC32 Error] CrearVariables.cpp(21): E2297 'this' can only be used within a member function...

despues lo intento tal y como esta en tu ejemplo pero me manda este error...
[BCC32 Error] CrearVariables.cpp(13): E2316 '_fastcall TForm1::CrearBoton(int)' is not a member of 'TForm1'


Me gustaria que me explicaras mejor ó como solucionar mi problema.. muchas gracias de ante mano... saludos
Responder Con Cita