CWnd *pWnd; pWnd = GetDlgItem( IDC_EDIT1 ); //获取控件指针,IDC_EDIT为控件ID号 pWnd->ShowWindow( SW_HIDE ); //隐藏控件
CWnd *pWnd; pWnd = GetDlgItem( IDC_EDIT1 ); //获取控件指针,IDC_EDIT为控件ID号 pWnd->ShowWindow( SW_SHOW ); //显示控件
m_Button1.EnableWindow(true); //使按钮处于允许状态 m_Button1.EnableWindow(false); //使按钮被禁止,并变灰显示
void MoveWindow(int x,int y,int nWidth,int nHeight); void MoveWindow(LPCRECT lpRect);
CWnd *pWnd; pWnd = GetDlgItem( IDC_EDIT1 ); //获取控件指针,IDC_EDIT1为控件ID号 pWnd->MoveWindow( CRect(0,0,100,100) ); //在窗口左上角显示一个宽100、高100的编辑控件 SetWindowPos()函数使用更灵活,多用于只修改控件位置而大小不变或只修改大小而位置不变的情况: BOOL SetWindowPos(const CWnd* pWndInsertAfter,int x,int y,int cx,int cy,UINT nFlags);
CWnd *pWnd; pWnd = GetDlgItem( IDC_BUTTON1 ); //获取控件指针,IDC_BUTTON1为控件ID号 pWnd->SetWindowPos( NULL,50,80,0,0,SWP_NOZORDER | SWP_NOSIZE ); //把按钮移到窗口的(50,80)处 pWnd = GetDlgItem( IDC_EDIT1 ); pWnd->SetWindowPos( NULL,0,0,100,80,SWP_NOZORDER | SWP_NOMOVE ); //把编辑控件的大小设为(100,80),位置不变 pWnd = GetDlgItem( IDC_EDIT1 ); pWnd->SetWindowPos( NULL,0,0,100,80,SWP_NOZORDER ); //编辑控件的大小和位置都改变
void CWEditView::OnRadio1()
{
m_Radio1 = 0; //第一个单选按钮被选中
}
void CWEditView::OnRadio2()
{
m_Radio1 = 1; //第二个单选按钮被选中
}
void CWEditView::OnRadio3()
{
m_Radio1 = 2; //第三个单选按钮被选中
}
void CWEditView::OnRadio4()
{
m_Radio4 = 0; //第四个单选按钮被选中
}
void CWEditView::OnRadio5()
{
m_Radio4 = 1; //第五个单选按钮被选中
}
//{{AFX_DATA_INIT(CWEditView)
m_Ridio1 = 0; //初始时第一个单选按钮被选中
m_Ridio4 = 0; //初始时第四个单选按钮被选中
//}}AFX_DATA_INIT
BOOL CMyDlg::OnInitDialog()
{
CDialog::OnInitDialog();
m_Spin.SetBuddy( GetDlgItem( IDC_EDIT1 ) ); //设置编辑控件为Spin控件的伙伴窗口
m_Spin.SetRange( 0, 10 ); //设置数据范围为0-10
return TRUE;
}
void CMyDlg::OnChangeEdit1()
{
m_Edit = m_Spin.GetPos(); //获取Spin控件当前值
}
m_Edit1 = _T("结果为50");
UpdateData(false);
void CEditView::OnChangeEdit1()
{
UpdateData(true); //更新变量值
}
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有