删除动态增加的按钮

xiaoyaofriend 2012-07-19 11:14:34
在对话框中,通过for循环动态增加了几百个按钮,相关代码如下,动态增加后再想删除他们,该怎么操作作呢?

for(int i=0;i<15;i++)

for(int j=0;j<15;j++)
{
pNewButton = new CButton();

CRect rcButton(50*i, 30*(j+4), 50*(i+1), 30*(j+5)); // 按钮在对话框中的位置。

CString str;

str.Format("%d",i*10+j);

pNewButton->Create(str, 0, rcButton, this, 10000+i*10+j);

pNewButton->ShowWindow(SW_SHOW);

//pNewButton->DestroyWindow();
}
...全文
94 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

15,979

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 界面
社区管理员
  • 界面
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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