控件主要函数

//checkbox  

getcheck()
setcheck()


//文本
void CMy03文本框Dlg::OnBnClickedButton1()
{
    // TODO:  在此添加控件通知处理程序代码
    m_ctrlEdit.SetWindowText(TEXT("asdhfadfajdfhj\r\nasdfasdf"));
    int n = m_ctrlEdit.GetLineCount();
    CString   buf;
    buf.Format(L"一共有%d行", n);
    MessageBox(buf);
}


//bitmap
        bitMap.LoadBitmap(IDB_BITMAP1);
    m_Picture.SetBitmap(bitMap);


//下拉
m_ctrlComboBox.AddString(TEXT("天津"));
m_ctrlComboBox.GetWindowText(buf);


//选项卡


m_ctrlTab.InsertItem(0, TEXT("哈哈"));
    m_ctrlTab.InsertItem(1, TEXT("呵呵"));

    m_DlgA.Create(IDD_DLGA, &m_ctrlTab);
    m_DlgB.Create(IDD_DLGB, &m_ctrlTab);

    m_ctrlTab.GetClientRect(rtParent);
    rtParent.DeflateRect(3, 20, 3, 3);

    m_DlgA.ShowWindow(SW_SHOW);
    m_DlgA.MoveWindow(rtParent, true);
    
    m_DlgB.ShowWindow(SW_HIDE);
    m_DlgB.MoveWindow(rtParent, true);


    int n = m_ctrlTab.GetCurSel();
    if (n==0)
    {
        m_DlgA.ShowWindow(SW_SHOW);
        m_DlgB.ShowWindow(SW_HIDE);
    }
    else if (n == 1)
    {
        m_DlgA.ShowWindow(SW_HIDE);
        m_DlgB.ShowWindow(SW_SHOW);
    }
    *pResult = 0;
}

 

posted @ 2016-03-22 09:50  天还是那么蓝  阅读(160)  评论(0编辑  收藏  举报