刘华世的官方博客

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);
}
posted @ 2012-11-13 17:27  pythonschool  阅读(2135)  评论(0编辑  收藏  举报
刘华世的官方博客