几个控件,报告用

来源:互联网 发布:现代网络新技术概论 编辑:程序博客网 时间:2024/06/05 11:23

编辑框

设置编辑框控件内容、获得编辑框内容

CString temp;
m_Edit4.GetWindowText(temp);
m_Edit4.SetWindowText(temp);

复选框

 

得到复选框状态的函数:CButton* pBtn = (CButton*)GetDlgItem(IDC_CHECK);

           int state = pBtnNONE->GetCheck();

           当state == 1时表示该复选框没有被选中;

           当state == 0时表示该复选框被选中;

设置复选框状态的函数:CButton* pBtn = (CButton*)GetDlgItem(IDC_CHECK);

           pBtnNONE->SetCheck(1);

           SetCheck(1)表示设置复选框为“选中”状态;

           SetCheck(0)表示设置复选框为“未选中”状态;

                                       注:非0也为“选中”。

组合框 OnSelchange函数

int nIndex = m_cbExample.GetCurSel();

CString strCBText;

m_cbExample.GetLBText( nIndex, strCBText);