Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

Using tabcontrols ... help!

Hi,

I'm using a TabControl control in one test proyect I'm developing since
some time (MFC and win32 API), but I cannot understand very well the mechanisms
to implement this control in my application. I wanna show a TabControl in
my application's main window, simmilarly to a PropertySheet (different dialog
boxes for each tab page).

Any of you has developed anything simmilar?

MFC or WinAPI, don't worry. I have experience, be so technical as you
want to.

Thank you in advance.
[554 byte] By [Alberto Curro] at [2007-11-10 12:51:09]
# 1 Re: Using tabcontrols ... help!
Place the tab in the dialog in the resource editor.
Map it to a CTabCtrl control to subclass it automatic to CTabCtrl
Create another 2 dialogs (for the 2 pages of your tab). MAke the dialogs,
no caption no border, WS_CHILD, WS_CONTROL as the same size as the tab control.
Place the controls inside dialogs. Create new cllases for them CYourDlg2
& CYourDlg1. Include the new h files for the new dialogs in your H file of
your main view. Add 2 members of type CYourDls1 and CYourDlg2.
In the OnCreate call for both dialogs Create(...) to make them modeless.
Add pages to the tab control and in lParam put the pointer to your members
dialogs. Then map on SelChanging and OnSelcHange for the TabControl. In OnSelChanging
Hide the current dialog. In OnSelChange Show the new dialog stored in lParam.

"Alberto Curro" <acurro@yahoo.com> wrote:
>
>Hi,
>
> I'm using a TabControl control in one test proyect I'm developing since
>some time (MFC and win32 API), but I cannot understand very well the mechanisms
>to implement this control in my application. I wanna show a TabControl in
>my application's main window, simmilarly to a PropertySheet (different dialog
>boxes for each tab page).
>
> Any of you has developed anything simmilar?
>
> MFC or WinAPI, don't worry. I have experience, be so technical as you
>want to.
>
> Thank you in advance.
marius at 2007-11-11 20:41:56 >
# 2 Re: Using tabcontrols ... help!
Hello,

how about CPropertySheet ? There are simple way to insert into project via
VC++'s Component Gallery...

--
ChainsaW
Stanislav Simicek at 2007-11-11 20:42:53 >