|
헐 안녕하세요. 이렇게 해보세요
헤더에는
class TForm1 : public TForm
{
__published: // IDE-managed Components <-------- IDE 가 노는부분이라는 뜻임
........................
private: // User declarations <--------- 폼 클래스 내부에서 노는넘만 적는다.
........................
public: // User declarations <--------- 이 클래스는 물론 다른 클래스에서도
부를수 있다.
int a;
__fastcall TForm1(TComponent* Owner);
};
이렇게...
소스에서는 생성자 부분에 이렇게 써줌다.
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
a = 5;
}
멤버함수에서는
void __fastcall TForm1::FormShow(TObject *Sender)
{
a = 10;
...............
}
다른 폼이나 클래스에서는
Form1->a = 15;
물론 헤더는 추가해야겠죠....
|