要改变静态文本框的值,必须设置静态文本框控件的样式中(Notify通知)勾选
CString str;
if(GetDlgItem(IDC_NUMBER1)->GetWindowText(str),str == "Number1:")
{
GetDlgItem(IDC_NUMBER1)->SetWindowText("数值1:");
}
else
{
GetDlgItem(IDC_NUMBER1)->SetWindowText("Number1:");
}
CString str;
if(GetDlgItem(IDC_NUMBER1)->GetWindowText(str),str == "Number1:")
{
GetDlgItem(IDC_NUMBER1)->SetWindowText("数值1:");
}
else
{
GetDlgItem(IDC_NUMBER1)->SetWindowText("Number1:");
}