第 7 页精品文档---下载后可任意编辑VC6.0 常用控件使用方法 1、-------------各类专业好文档,值得你下载,教育,管理,论文,制度,方案手册,一应俱全--------------VC6.0 常用控件使用方法.educity.cn 发布者:zkhenry 来源:网络转载发布日期:2024 年 10 月 29 日*除非特别说明,本文中所用控件变量类型为Control 一 般 控 件 可 用 / 不 行 用 EnableWindow 〔 TRUE 〕 ;EnableWindow〔FALSE〕;1、StaticText------------静态控件--类CStatic取值/赋值〔变量类型为Control〕m_lbl.GetWindowText〔string〕;m_lbl.SetWindowText〔string〕;2、EditBox---------------编辑控件--类 CEdit 取 2 、 值 / 赋 值 m_txt.GetWindowText 〔 string 〕 ;m_txt.SetWindowText〔string〕;3、CheckBox------------复选控 件 -- 类CButton 〔 1 〕 设 置 选 中/ 未 选 中m_chk.SetCheck〔BST_CHECKED〕;m_chk.SetCheck 〔 BST_UNCHECKED 〕 ; 〔 2 〕 推 断 是 否 选 中intnCur=m_chk.GetCheck 〔 〕 ; nCur 取 值 为 BST_CHECKED/BST_UNCHECKED 。 4 、 RadioBox------------ 单 项 选 择 控 件 -- 类CButton〔1〕默认选中第一项m_radio.SetCheck 〔 BST_CHECKED 〕 ; 〔 2 〕 选 中 组 中 任 一 项CWnd::CheckRadioButtonSelects〔a 3、ddsacheckmarkto〕agivenradiobuttoninagroupandclears第 8 页精品文档---下载后可任意编辑〔removesacheckmarkfrom〕allotherradiobuttonsinthegroup.voidCheckRadioButton〔intnIDFirstButton,intnIDLastButton,intnIDCheckButton〕;ParametersnIDFirstButtonSpecifiestheintegeridentifierofthefirstradiobuttoninthegroup.nIDLastButtonSpecifiestheintegeridentifierofthelastradiobuttoninthegroup.nIDCheckButt 4、onSpecifiestheintegeridentifieroftheradiobuttontobechecked.〔3〕推断哪一项被选中CWnd::GetCheckedRadioButtonRetrievestheIDofthecurrentlycheckedradiobuttoninthespecifiedgroup.intGetCheckedRadioButton〔intnIDFirstButton,intnIDLastButton〕;ParametersnIDFirstButtonSpecifiestheintegeridentifierofthefirstradiobuttoninthegroup.nIDLastButtonSpecifiestheintegeridentifi 5、erofthelastradiobuttoninthegroup.ReturnValueIDofthecheckedradiobutton,or...