拜托高手帮我看看这段代码。

bomb_hero 2001-04-03 11:33:00
TBitBtn *MainSpeedButton[10][10];
for(i=0;i<10;i++)
for(j=0;j<10;j++)
{
MainSpeedButton[i][j]=new TBitBtn();
MainSpeedButton[i][j]->Width=16;
MainSpeedButton[i][j]->Height=16;
MainSpeedButton[i][j]->Left=i*16;
MainSpeedButton[i][j]->Top =j*16;

}
其中MainSpeedButton[i][j]=new TBitBtn();
这一句在编译的时候出错,什么问题啊?该怎么写呢?
...全文
73 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
「已注销」 2001-04-09
  • 打赏
  • 举报
回复
该给分了吧
要不我去打小报告也……
luhongjun 2001-04-07
  • 打赏
  • 举报
回复
yeqiufeng(叶秋枫)说的对,加上MainSpeedButton[i][j]=new TBitBtn(this);
之后,编译肯定能通过,只是这些按钮无法显示。 
「已注销」 2001-04-07
  • 打赏
  • 举报
回复
提示出什么错呢

没指定父窗口是不能显示的

这不假

玻璃人说得也不错

应该可以了啊
blre 2001-04-04
  • 打赏
  • 举报
回复
改成这样试一试
MainSpeedButton[i][j]=new TBitBtn(this);
holyfire 2001-04-04
  • 打赏
  • 举报
回复
TBitBtn需要一个父窗体来容纳它,
__fastcall virtual TBitBtn(Classes::TComponent* AOwner);
AOwner就是TBitBtn的祖先窗体,和它公用一个进程
比如
TBitBtn * myBtiBtn = new TBitBtn( Form1 );
就是在Form1后加一个后继窗体
要将myBitBtn显示在窗体上,必须将其变成Form1的子窗体
myBitBtn->Parent = Form1;

13,824

社区成员

发帖
与我相关
我的任务
社区描述
C++ Builder相关内容讨论区
社区管理员
  • 基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧