604
社区成员
发帖
与我相关
我的任务
分享
void __fastcall TForm1::FormClick(TObject *Sender)
{
TButton* btn = new TButton(this);
btn->Parent = this;
TPoint p;
p.x = Mouse->CursorPos.x;
p.y = Mouse->CursorPos.y;
p = ScreenToClient(p);
btn->Left = p.x - btn->Width/2;
btn->Top = p.y - btn->Height/2;
btn->Caption = "New Button";
}