FTP | CCD | Buscar | Trucos | Trabajo | Foros |
|
Registrarse | FAQ | Miembros | Calendario | Guía de estilo | Temas de Hoy |
|
Herramientas | Buscar en Tema | Desplegado |
#1
|
|||
|
|||
borrar o liberar componente TBITBTN en tiempo de ejecucion
Hola estube checando los temas relacionados pero no me han servido o talvez algotengo mal, miren yo creo un determinado numero de botones asi
for i:=0 to slCampos.Count-1 do begin Boton := TBITBTN.Create(Self); Boton.Parent := ScrollBox1;//Asignamos como padre al ScrollBox if b=4 then begin aTop := aTop+ Boton.height; b:=0; aLeft := 10; Boton.Left := aLeft; inc(aLeft,Boton.Width+40); end else begin Boton.Left := aLeft; inc(aLeft,Boton.Width+40); end; Boton.Top := aTop; b:=b+1; Boton.Width := 110; If slestado[i]='0'then begin Boton.Kind:= bkOK; end else If slestado[i]='3'then Boton.Kind:= bkNo else If slestado[i]='1'then Boton.Kind:= bkIgnore; Boton.Name := 'Hab'+slCampos[i]; Boton.Caption := slnombres[i]; Boton.OnClick := ClickBotones; end; esos me los crea apretendo un boton fuera del ScrollBox1 entonces hago un proceso activando el boton en el evento onclick, entonces quiero que al terminar ese proceso me borre o me libere los botones porque la cantidad de botones creados depende de una variable que se actualiza en este evento. puse este codigo la cantidad de botones creados es 12 entonces cuando empieza a liberar en el x=6 marca error dice"List indexout of bounds(6)" for x := 0 to ScrollBox1.ControlCount -1 do begin if ScrollBox1.Controls[x] is TBITBTN then TBITBTN(ScrollBox1.Controls[x]).Free; end; |
|
|
Temas Similares | ||||
Tema | Autor | Foro | Respuestas | Último mensaje |
Componente En Tiempo De Ejecucion | grandmasterdari | OOP | 28 | 03-05-2008 20:55:03 |
Borrar los Datasource Creados en tiempo de ejecucion | Nieto | OOP | 2 | 29-11-2007 22:12:19 |
Crear y Borrar componentes en tiempo de ejecución | jzginez | OOP | 6 | 25-11-2005 16:04:55 |
Crear componente Image en tiempo d Ejecucion | Jessica666 | Gráficos | 6 | 30-05-2004 01:58:22 |
Creacion de componente en tiempo de ejecución | cone220 | OOP | 1 | 16-09-2003 03:47:16 |
|