Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

how to calculate number of tabs  of CTabCtrl

Posted on 2014-03-31
1
Medium Priority
?
612 Views
Last Modified: 2014-03-31
I am  modifying  application  developed  in VC++,MFC 6.0
There  are  seven  tabs  in  tab control.I  have  been asked  to  develop  a  functionality  such  that  when user  clicks  fifth  tab ,sixth  and  seventh  tab  should be  visible  and  when user  clicks  any  of  first  four  tabs,sixth  and  seventh  tab  should  be  invisible.
What  I  am  doing  now  is  on  fifth  tab  On_Show_Window  i am  inserting  two  tabs  and  when  user  presses  any of  first  four  tab  I  am  deleting  last  two  tabs.Problem  is  now
if  user  presses  any of  tab  repeatedly error  comes  because  i  dont  have  run  time  count  of  number  of  tabs,There  is  one  public  variable  m_nNumberOfTab,something  like  that  of inherited  class(Inherited  from CTabCtrl) but  that variable  always  writtens  value  7  irrespective  of actual  count.Please  help  how  to get actual count
0
Comment
Question by:ADITYA RAO
[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
1 Comment
 
LVL 86

Accepted Solution

by:
jkr earned 1940 total points
ID: 39966904
'CTabCtrl::GetItemCount()' (http://msdn.microsoft.com/en-us/library/ca3h5k6c%28v=vs.90%29.aspx) should give you the information that you need:

Retrieves the number of tabs in the tab control.
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

The following diagram presents a diamond class hierarchy: As depicted, diamond inheritance denotes when two classes (e.g., CDerived1 and CDerived2), separately extending a common base class (e.g., CBase), are sub classed simultaneously by a fourt…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

704 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