Solved

how to calculate number of tabs  of CTabCtrl

Posted on 2014-03-31
1
542 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 485 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

734 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