【发布时间】:2011-06-09 08:12:43
【问题描述】:
我不是用设计师创建的按钮,但我不知道如何为点击事件分配任何功能。
TButton *tl[15][15];
void __fastcall TForm1::MyButtonClick(TObject *Sender)
{
TButton *tlakt;
tlakt=(TButton*)Sender;
...
}
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
for (i=0;i<15;i++) for (j=0;j<15;j++){
tl [i][j]=new TButton(this);
tl [i][j]->Caption="";
tl [i][j]->Width=24;
tl [i][j]->Height=24;
tl [i][j]->TabStop=false;
tl [i][j]->Left=50+i*28;
tl [i][j]->Top=50+j*28;
tl [i][j]->Tag=i*100+j;
/* SET MyButtonClick as EVENT FUNCTION */
InsertControl (tl[i][j]);
}
}
【问题讨论】:
-
@owen 您使用的是哪个版本的 C++ Builder?
标签: c++ vcl borland-c++