![]() |
![]() |
| Paypal | FTP | CCD | Buscar | Trucos | Trabajo | Foros |
|
|||||||
| Registrarse | FAQ | Miembros | Calendario | Guía de estilo | Buscar | Temas de Hoy | Marcar Foros Como Leídos |
|
|
Herramientas | Buscar en Tema | Desplegado |
|
#1
|
|||
|
|||
|
Error "A control cannot have itself as its parent"
Buenos dias, les comento... estoy tratando de crear objetos(botones, edit y demas cosas que se me ocurran) en una grilla.. cuando ejecuto el programa recibo este error al hacer la llamada a mi procedimiento
"A control cannot have itself as its parent" la llamada es Código:
stgboton(1, StringGrid1, 'hola', EventoClick, 5 ); Código:
procedure stgboton(objeto:integer; Grid : TStringGrid; txtcaption:string; evento:TNotifyEvent; columna:integer);
var
i: Integer;
Btn: TObject;
begin
for i := Grid.FixedRows to Grid.RowCount -2 do
begin
if objeto = 1 then
begin
with TButton (btn) do
begin
Create(nil);
Caption := txtboton;
Width := 87;
Name := 'Button' + IntToStr(i);
BoundsRect:= Grid.CellRect(Columna, i);
ControlStyle := [csClickEvents];
onclick := evento;
Tag := i;
parent:= grid;
end;
Grid.Objects[Columna,i] := Btn;
end;
end;
end;
|
| Herramientas | Buscar en Tema |
| Desplegado | |
|
|
Temas Similares
|
||||
| Tema | Autor | Foro | Respuestas | Último mensaje |
| Usar TServerSocket y TClientSocket para enviar "streams" más o menos "grandes" | dec | Internet | 9 | 04-08-2015 16:11:50 |
| EInvalidOperation with message 'Control" has no parent | mrnovice | OOP | 4 | 18-08-2008 18:53:05 |
| Cómo acceder a las propiedades de un "Parent" | NeoAnderson | API de Windows | 14 | 12-02-2008 21:13:46 |
| Parent, ParentWindow, objetos y el error Control has no parent Window | dec | Varios | 18 | 07-08-2007 15:02:01 |
| Necesito llamar a métodos de clases "hija" desde su clase "padre" | Flecha | OOP | 17 | 20-04-2007 00:03:53 |
|