Board index » Visual Studio » Tab controls

Tab controls

Visual Studio306
How does one implement a tab control in a Visual Studio MFC

application? In the old Win32 GUI days, when dialogs might be

dynamically constructed by the application, PropertyPage API functions

were used. I see Visual Studio [2005] dialog editor has a tab control

object, which can be placed on a dialog box, but it appears impossible

to manipulate the individual tab pages from the dialog editor. I am

going to guess that separate dialogs must be created, which are then

[somehow] attached to each tab page, perhaps when the application

detects a particular tab page has been selected, and then performs a

dlg.DoModal for the appropriate dialog on the appropriate tab page. Is

this correct? Is there any doc or tutorial that addresses this process?

Thanks.


-
 

Re:Tab controls

Frank Natoli wrote:

Quote
How does one implement a tab control in a Visual Studio

MFC application? In the old Win32 GUI days, when dialogs

might be dynamically constructed by the application,

PropertyPage API functions were used.



Property Sheets control is available and you can use it as

before. MFC has CPropertySheet and CPropertyPage classes to

manipulate Property Sheets control.



"Property Sheets"

msdn2.microsoft.com/en-us/library/cfs4wk4e(VS.80).aspx">msdn2.microsoft.com/en-us/library/cfs4wk4e(VS.80).aspx



Quote
I see Visual Studio

[2005] dialog editor has a tab control object, which can

be placed on a dialog box, but it appears impossible to

manipulate the individual tab pages from the dialog

editor. I am going to guess that separate dialogs must be

created, which are then [somehow] attached to each tab

page, perhaps when the application detects a particular

tab page has been selected, and then performs a

dlg.DoModal for the appropriate dialog on the appropriate

tab page. Is this correct?



Yes, this is correct. Tab control is just set of stupid

tabs. You need to manage everything by yourself. Usually,

you prepare child dialog boxes, then when tab is shown, you

just show appropriate child dialog box and hide previous

one. You will need parent dialog which will conatain both

Tab control and child dialog(s). Only one child dialog is

visible at the time, so it gives an impression that tab

"changes".



Quote
Is there any doc or tutorial

that addresses this process?



There are plenty of resources for MFC Tabs/Propery Sheets.



"PROPDLG Sample: Demonstrates Property Sheet Support"

msdn2.microsoft.com/en-us/library/et63ay6a.aspx">msdn2.microsoft.com/en-us/library/et63ay6a.aspx



"Property Sheet and Property Page articles"

www.codeproject.com/property/">www.codeproject.com/property/



HTH

Alex







-