C++语言 设置对话框的标题

BOOL CMfcDlg::OnInitDialog()
{
    CDialog::OnInitDialog();
    this->SetWindowText("蟒蛇软件站");
    return TRUE;  
}

void CCalcDlg::OnCalc()
{
    CString strText = _T("");
    GetWindowText(strText);
    SetDlgItemText(IDC_EDIT1, strText);
    
    SetWindowText("pythonschool.com");
}

void CDemoDlg::OnTest1() 
{
    CString strText = _T("");

    //获得窗口标题
    GetWindowText(strText);

    SetDlgItemText(IDC_TEXT, strText);
}

void CDemoDlg::OnTest2() 
{
    CString strText = _T("");

    GetDlgItemText(IDC_TEXT, strText);

    //设置窗口标题
    SetWindowText(strText);
}
学习笔记转摘于: 丝酷网 http://www.pythonschool.com/
原文地址:https://www.cnblogs.com/pythonschool/p/2768385.html