Witam.
Mam problem, a mianowicie przy dodawaniu Labela kodem(nie przez formatkę) dodawając do Unit1.h:
TLabel *Label1;
w sekcji private i w Unit1.cpp:
__fastcall TForm1::TForm1(TComponent* Owner) : TForm(Owner) { Label1 = new TLabel(this); Label1->AutoSize = false; Label1->Caption = "Tekst"; Label1->Left = 0; Label1->Top = 0; Label1->Visible = true; }
Po dodaniu tych elementów i po skompilowaniu i uruchomieniu programu nie widać label'a.
ten sposób powinien chyba działać, bo przy tworzeniu Timera tą metodą on działa...
PS. Timer tworzę dodając do pliku Unit1.h w sekcji private:
TTimer *Timer; void __fastcall TimerTimer(TObject *Sender);
w formatce dodaje Label'a o nazwie Label1 i dodaje w Unit1.cpp :
int t=0; void __fastcall TForm1::TimerTimer(TObject *Sender) { t++; Label1->Caption = IntToStr(t); }