如何获得对话框指针 .

获得对话框指针: 假设CMyDialog为对话框类
1.先在CMyDialog.cpp中声明一个全局变量CMyDialog* pDlg;
2在OnInitDialog()的时候,pDlg = this;
3.在别的类使用他的时候,在别的类的Cpp中添加extern CMyDialog* pDlg;
4.pDlg->yourfunction();
如何使用Tab Control 控件 设置现有页面


 


void CPage1::OnBnClickedButton1()
{
	int temp=0;
	if(GetCheckedRadioButton(IDC_RADIO1,IDC_RADIO2)==IDC_RADIO1)
		temp++;
	if(GetCheckedRadioButton(IDC_RADIO3,IDC_RADIO4)==IDC_RADIO3)
		temp++;
	if(GetCheckedRadioButton(IDC_RADIO5,IDC_RADIO6)==IDC_RADIO5)
		temp++;

	//获取View类指针
	CMainFrame *pMain=(CMainFrame *)AfxGetApp()->m_pMainWnd;
	CintelligentjudgingView *pView=(CintelligentjudgingView *)pMain->GetActiveView();
	if(temp>=2)
	{
		extern CQue *myquedlg;
		pView->type[0]++; 
		MessageBox((CString)"Please continue to next step!");
		CRect     r;   
		myquedlg->m_tabcontrol.GetClientRect(&r);    
		myquedlg->m_tabcontrol.SetCurSel(1);
		myquedlg->page1.SetWindowPos (NULL,10,30,r.right-20,r.bottom-40,SWP_HIDEWINDOW); 
		myquedlg->page2.SetWindowPos (NULL,10,30,r.right-20,r.bottom-40,SWP_SHOWWINDOW);
		myquedlg->page3.SetWindowPos (NULL,10,30,r.right-20,r.bottom-40,SWP_HIDEWINDOW   );
	}
	// TODO: 在此添加控件通知处理程序代码
}

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值