Solved

how to calculate number of tabs  of CTabCtrl

Posted on 2014-03-31
1
473 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:enthurao
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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

757 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now