Ver Mensaje Individual
  #1  
Antiguo 21-06-2013
DSK25 DSK25 is offline
Miembro
NULL
 
Registrado: jun 2012
Posts: 46
Reputación: 0
DSK25 Va por buen camino
Juntar dos componentes en una clase

Pues quiero crear una clase que derive del TPanel y que contenga un Panel y un listbox

TblPanel.h

Código:
//--------------------------------------------------------------------------- 
#ifndef TblPanelH 
#define TblPanelH 
//--------------------------------------------------------------------------- 
class TTblPanel : public TPanel 
{ 
__published: 
private: 
    TTblPanel *TblPanel; 
    TListBox *ListBox1; 
    TPanel *Panel2; 
public: 
    __fastcall TTblPanel(TWinControl *Parent); 
}; 
//--------------------------------------------------------------------------- 
#endif
TblPanel.cpp

Código:
//--------------------------------------------------------------------------- 
#include <vcl.h> 
#include "TblPanel.h" 
//--------------------------------------------------------------------------- 
__fastcall TTblPanel::TTblPanel(TWinControl *Parent) 
    : TPanel(Owner) 
{ 
    TTblPanel::Parent = Parent; 
    TTblPanel::Height = 200; 
    TTblPanel::Width = 160; 
    TTblPanel::Visible = true; 
    TTblPanel::Panel2->Caption = "yyy"; 
    TTblPanel::Panel2->Align = alTop; 
    TTblPanel::ListBox1->Align = alClient; 
} 
//---------------------------------------------------------------------------
Al compilar me manda el error "Access violation address ...", alguien sabe en que fallo?
Responder Con Cita