16,548
社区成员




CWnd* pWnd = GetDlgItem(IDC_BUTTON4);
static int i = 0;//这里要设置成静态变量
i++;
CString str;
str.Format(_T("第%d次操作该按钮 "),i);
pWnd->SetWindowText(str);
CWnd* pWnd = GetDlgItem(IDC_BUTTON4);
int i;
CString str;
//新名称为:第i次操作该按钮
str.Format(_T("第%d次操作该按钮 "),i);
pWnd->SetWindowText(str);
i++;
CString str;
str.Format(_T("%d次改了控件"),i);
GetDlgItem(IDC_BUTTON)->SetWindowText(str);
CWnd* pWnd = GetDlgItem(IDC_BUTTON4);
int i;
CString str;
//新名称为:第i次操作该按钮
str.Format(_T("第%d次操作该按钮 "),i);
pWnd->SetWindowText(str.GetBuffer(str.GetLength());