void CMFCApplication1Dlg::OnBnClickedOk()
{
for (int i = 0; i < 100; ++i)
{
for (int j = 0; j < 100; ++j)
{
CButton* pButton3 = new CButton;
pButton[i][j] = pButton3;
}
}
CRect rect;
GetClientRect(&rect); // 获取对话框客户区的大小
rect.top += 10; // 设置按钮的位置
rect.bottom = rect.top + 20; // 设置按钮的高度
rect.left += 10; // 设置按钮的位置
rect.right = rect.left + 20; // 设置按钮的宽度
for (int i = 0; i < 20; ++i)
{
rect.left += +20; // 设置按钮的位置
rect.right = rect.left + 20; // 设置按钮的宽度
rect.top = 0;
for (int j = 0; j < 20; ++j)
{
rect.top += 20; // 设置按钮的位置
rect.bottom = rect.top + 20;
bool ret = pButton[i][j]->Create(_T(""), WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON, rect, this, 1993 + i * 100 + j);
ret = false;
}
}
}
05-12
1107
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
05-03
4856
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交