?
Solved

Enquery about Tab Control

Posted on 2003-03-31
4
Medium Priority
?
175 Views
Last Modified: 2013-11-20
hi, i'm a newbie to visual c++ and needs some expert guidance :)
i am adding controls to a dialog using control toolbars, but when i try to use drag and put the Tab Control onto my dialog, i discover that it actually gave me 5 tabs and i can't find way to change that.
i would like to

1) Change the number of tab to 3 instead of 5
2) Instead of tag being name "Tag 1", "Tag 2", "Tag 3", how can i set the name to like eg. "Graphs", "Forms", "Values"?

Any help would be greatly appreciate. Thanks.
0
Comment
Question by:Kyoshiro
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 48

Expert Comment

by:AlexFM
ID: 8243739
Tab control is shown by such way in dialog template. Actually it doesn't have tabs, they should be added programmatically. Add class member fot this tab control (for example, m_tab_ctrl) and add the following lines to OnIntiDialog:

m_tab_ctrl.InsertItem(0, "Item 0");
m_tab_ctrl.InsertItem(1, "Item 1");

Now the control has 2 tabs.
0
 

Author Comment

by:Kyoshiro
ID: 8244018
Ic. Thanks Alex, i now get the idea of the Tag control having to be program. But i still don't get what you meant by
1) "Add class member fot this tab control (for example, m_tab_ctrl)"

2) "add the following lines to OnIntiDialog:
m_tab_ctrl.InsertItem(0, "Item 0");
m_tab_ctrl.InsertItem(1, "Item 1");"

erm, can you explain more on 1)?
About 2), do you mean adding both those lines in the
e.g.
/* BOOL CFYPDlg::OnInitDialog()
  {
     CDialog::OnInitDialog();
*/ ?

Thanks again.
0
 
LVL 48

Accepted Solution

by:
AlexFM earned 80 total points
ID: 8244087
1) View - Class Wizard - Member Variables. Select your class in Class name combo. Select tab control ID in list. Click Add Variable. Fill variable name m_tab_ctrl.

2) I suppose you have already function OnInitDialog. Add two lines before the line

return TRUE;
0
 

Author Comment

by:Kyoshiro
ID: 8244167
Yes~. Thanks pal. Thanks for the help :)
0

Featured Post

Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question