我们如何从父容器(包含TAB CONTROL的CDialog)访问选项卡内的控件 [英] How can we Access a control inside a tab from the parent container (CDialog that contains the TAB CONTROL)
本文介绍了我们如何从父容器(包含TAB CONTROL的CDialog)访问选项卡内的控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我们如何从父容器(包含TAB CONTROL的CDialog)访问选项卡内的控件
我想从CDIALOG中访问一个编辑框,该编辑框已从包含选项卡控件的CDIALOG中分配给TAB.有任何建议吗?
How can we Access a control inside a tab from the parent container (CDialog that contains the TAB CONTROL)
I want to access an edit box from a CDIALOG that was assigned to a TAB from a CDIALOG that contains the tab control. Any Suggestions?
推荐答案
在这种情况下,Tab控件无关紧要.我假设您拥有带有编辑控件的CDialog对象(您已经创建了它),因此只需将其用作控件本身或子类成员的基础.
我一直在用
这样的电话来做到这一点
The Tab Control doesn''t matter in this case. I assume you have the CDialog object with the edit control (you created it) so just use it as the base for the control itself or the member subclassed.
I do this all the time with calls like
OptionsPage->Create(IDD_OptionsDialog);
// then it gets placed in my tab control.
// regardless of the tab control, I can still access controls in it.
OptionsPage->SetDlgItemText(IDC_FLP_Rec12K, "Choose a layout");
其中OptionsPage是CDialog派生的类,并已放置在选项卡控件上.无论"OptionsPage"是否可见(活动选项卡均不可见),此方法均有效.
where OptionsPage is a CDialog derived class and has been placed on a tab control. This works regardless of whether "OptionsPage" is visible or not (the active tab or not).
这篇关于我们如何从父容器(包含TAB CONTROL的CDialog)访问选项卡内的控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文