Click here to Skip to main content
15,904,935 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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?
Posted

1 solution

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");

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).
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900