WinAPI: Tab Control with Dialogs

Started by
2 comments, last by gan 17 years, 10 months ago
Hi I'm trying to create a tab control within my dialog. The dialog containing the tab control is created with the dialog editor in visual studio. the data to be shown inside the tab control are also dialogs created the same way (one dialog per tab). I tried the example found in the MSDN but it did not really help me... I couldn't get it to work. I already searched the internet and tried some things... but i don't want to waste too much time on that. So my question: does anyone have a simple example (best would be a working visual studio project) showing how to do what i'm trying to? that would be great! Any tips or different approaches are welcome. What i need is a dialog that contains different control elements plus a tab control. The tabs need to contain different control elements themselves. Thanks in advance! rou
Advertisement
It's a bit of work in pure Win32 API (no MFC).

All the tab content dialogs are created as child dialogs, hidden on creation. Make sure to position and resize the child dialogs according to the RECT you can calculate via TCM_ADJUSTRECT.

When you receive the message TCN_SELCHANGE you hide the current dialog and show the new dialog.

Fruny: Ftagn! Ia! Ia! std::time_put_byname! Mglui naflftagn std::codecvt eY'ha-nthlei!,char,mbstate_t>

Ok, I figured it out.

The MSDN example was a bit confusing. It created and destroyed the dialogs all the time and even by copying the code I couldn't get it to run.

I changed some things. Now, as you suggested, I create my dialogs and let them be hidden until a tab is selected. Then I just show the requested dialog. It's so much simpler than the MSDN example makes believe. Another confusing thing was the calculation of the sizes in the example. I also stripped that down to the needed.

Thanks for the help. If anyone else has the same problem and is searching for a solution, mail me at "mail@smronline.de".

rou
I created one when I was learning with gametutorial. I dunno is that what u want.

This topic is closed to new replies.

Advertisement