首页 相关文章 在BCB中使用VCL控件数组1

在BCB中使用VCL控件数组1

  昨晚和网友邬彦华在OICQ上闲聊,他言及正在为朋友编一个游戏菜单,其中动态创建了一组按纽,最后却无法释放。他的实现方法如下:

  

for (int i=1;i=ButtonCount;i++)
{
TSpeedButton *spdBtn=new TSpeedButton(this);
spdBtn-Parent=ScrollBox;//指定父控件
spdBtn-Caption=IntToStr(i);
spdBtn-Width=80;
spdBtn-Height=80;
spdBtn-OnClick=ButtonClick;
spdBtn-Left=intLeft;
spdBtn-Top=intTop;
spdBtn-GroupIndex=1;
spdBtn-Flat=true;
intLeft=intLeft+80+intSpace;
if (i%LineCount==0)
{
intTop=intTop+80+intSpace;
intLeft=intSpace;
}
buttons-Add(spdBt...[ 查看全文 ]

2016-02-19 标签:

在BCB中使用VCL控件数组1的相关文章

手机页面
收藏网站 回到头部