Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using CTabCtrl

Status
Not open for further replies.

Skute

Programmer
Jul 21, 2003
272
0
0
GB
Hi, how do i use CTabCtrl? Ive added the control to my dialog and added 4 tabs to it. Now how do i actually add items to the tab control? Or is that not how it works? As far as i can make out, you need to load up 4 different dialogs with no frames, then show or hide them depending on what tab is selected. Is this correct?

Skute

"There are 10 types of people in this World, those that understand binary, and those that don't!"
 
It depends on what you're trying to do. Basically, you're right in that you'll have to create different things for each tab.

For example, if you're wanting a list control in each tab, you'll need to create a separate list control for each tab. When a tab is selected, show the corresponding list control and hide any of the others that may have been active.
 
CTabCtrl is a pain to use. I would suggest using CPropertySheet and CPropertyPage to create a tabbed dialog - it's much easier, although there are a few things you won't be able to do, for a basic tabbed dialog it is fine and very simple.
 
Its ok, ive written my own CTabWndCtrl class which works really well. InsertItem() has been overwritten so that it accepts a CWnd* and when the tab is changed, it automatically shows the right window.

Skute

"There are 10 types of people in this World, those that understand binary, and those that don't!"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top