TRectangle같이 TGraphicControl을 배이스로 작성된 컴포넌트는 자식 컴포넌트를 가질 수 없습니다.
TWinControl 을 배이스로 하는 TPanel등으로 교체하여 작성해 보세요.
Form Design 화면에서 TRectangle을 하나 올려두고 TLabel을 그 않에 넣어 보세요.
아마 안들어 갈겁니다.
오스 님이 쓰신 글 :
: //---------------------------------------------------------------------------
:
: #include <fmx.h>
: #pragma hdrstop
:
: #include "Unit1.h"
: //---------------------------------------------------------------------------
: #pragma package(smart_init)
: #pragma resource "*.fmx"
: TForm1 *Form1;
: TLabel *Label[100];
: TRectangle *sha[100];
: int g=0,i=0,a[4];
: //---------------------------------------------------------------------------
: __fastcall TForm1::TForm1(TComponent* Owner)
: : TForm(Owner)
: {
: }
: //---------------------------------------------------------------------------
: void __fastcall TForm1::comehere(AnsiString a, int b, int c)
: {
: sha[i]=new TRectangle(this);
: sha[i]->Parent=this;
: sha[i]->Position->X=320;
: sha[i]->Position->Y=72+g;
: g=g+60;
: sha[i]->Height=50;
: sha[i]->Width=c;
: sha[i]->Stroke->Color=NULL;
: sha[i]->Fill->Color=b;
: i++;
:
: Label[i]=new TLabel(this);
: Label[i]->Parent=sha[i];
: Label[i]->Text=a;
: Label[i]->Align=L->Align;
: Label[i]->StyledSettings=L->StyledSettings >> TStyledSetting::ssFamily >> TStyledSetting::ssSize >> TStyledSetting::ssFontColor >> TStyledSetting::ssStyle;
: Label[i]->TextSettings->HorzAlign=L->TextSettings->HorzAlign;
: Label[i]->TextSettings->VertAlign=L->TextSettings->VertAlign;
: Label[i]->Font->Size=15;
: Label[i]->FontColor=L->FontColor;
: //Line1->Height+=70;
:
:
: }
: //---------------------------------------------------------------------------
: void __fastcall TForm1::Rectangle1Click(TObject *Sender)
: {
: comehere(Label1->Text, Rectangle1->Fill->Color,Rectangle1->Width);
: }
: //---------------------------------------------------------------------------
:
:
:
:
:
:
: RAD에서 일케짜봤는데 그럼 라텐글과 라벨이 같이 생성되야하는데 라텐글만생성되거 라벨은 생성이 안되네요..........하....................... 왜 안되는지좀 알려주세요 ㅠㅠㅠ
|