Ver Mensaje Individual
  #4  
Antiguo 21-07-2007
Avatar de GerTorresM
GerTorresM GerTorresM is offline
Miembro
 
Registrado: nov 2005
Ubicación: Tunja - Boyacá
Posts: 210
Reputación: 19
GerTorresM Va por buen camino
Unhappy Codigo Completo

Como tal vez o fui claro en la pregunta, me permito enviar la totalidad del código (no es muy largo por fortuna), y para mayor información estoy trabajando en Delphi 6 Enterprise.

el código es el siguiente

unit UFormulario;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, QComCtrls,DB, ComCtrls, QDBGrids;
type
TForm1 = class(TForm)
procedure FormCreate(Sender: TObject);
procedure FormDestroy(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
PCInformacion : TPageControl;
DTPFecha : TDateTimePicker;
Hoja1, Hoja2: TTabSheet;
DataSource : TDataSource;
DBGDatos: TDBGrid;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
PCInformacion:= TPageControl.Create(Self);
with PCInformacion do
begin
Parent:= Form1;
Align:= AlClient;
end;
Hoja1:=TTabSheet.Create(PCInformacion);
with Hoja1 do
begin
PageControl:= PCInformacion;
Caption:= 'Hola Mundo';
DTPFecha:= TDateTimePicker.Create(Self);
DBGDatos:= TDBGrid.Create(Self);
DataSource:= TDataSource.Create(Self);
DTPFecha.Parent:= Hoja1;
DBGDatos.Parent := Hoja1; // aqui es donde sale el error mencionado en la pregunta
end;
Hoja2:= TTabSheet.Create(PCInformacion);
with Hoja2 do
begin
PageControl:= PCInformacion;
Caption:= 'Hola Mundo en la Hoja 2';
end;
end;
procedure TForm1.FormDestroy(Sender: TObject);
begin
DTPFecha.Destroy;
Hoja1.Destroy;
Hoja2.Destroy;
PCInformacion.Destroy;
end;
end.

Gracías de antemano por su tiempo y colaboración
Responder Con Cita