Foros Club Delphi

Foros Club Delphi (https://www.clubdelphi.com/foros/index.php)
-   OOP (https://www.clubdelphi.com/foros/forumdisplay.php?f=5)
-   -   Crear un PageControl, Hojas y demás.. (https://www.clubdelphi.com/foros/showthread.php?t=66600)

GerTorresM 03-03-2010 01:39:39

Crear un PageControl, Hojas y demás..
 
Hola a todos:


La situación que en la fecha se me presenta es la siguiente :

Tengo que crear mediante código un PageControl, en este insertar algunas hojas y en las hojas insertar un TStringGrid, pero la verdad no tengo mucha idea y he tenido problemas con el parentesco al adicionar algunos componentes a las hojas.

Agradezco de antemano comentarios y ejemplos.



gracías de antemano




gertorresm
Colombia

Caro 03-03-2010 02:54:42

Hola GerTorresM, te pongo un ejemplo, crea 4 pestañas y un StringGrid en cada una de ellas.

Código Delphi [-]
 TabSheet : TTabSheet;
 PageCtrl : TPageControl;
 StringGrid : TSTringGrid;
begin
 PageCtrl := TPageControl.Create(Self);
 PageCtrl.Parent := Self;
 PageCtrl.Name := 'PageCtrl';
 PageCtrl.Top := 100;
 PageCtrl.Left := 100;
 for ind:=0 to 3 do
  begin
   TabSheet := TTabSheet.Create(PageCtrl);
   TabSheet.PageControl := PageCtrl;
   TabSheet.Name := 'TabSheet'+IntToSTr(Ind);
  
   StringGrid := TSTringGrid.Create(Self);
   StringGrid.Parent := TabSheet;
   StringGrid.Name := 'StringGrid'+IntToSTr(Ind);
  end;

Saluditos

GerTorresM 03-03-2010 22:10:55

Muchas Gracías
 
Te agradezco la solución propuesta me parecio excelente


La franja horaria es GMT +2. Ahora son las 17:09:14.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi