Solved

how to calculate number of tabs  of CTabCtrl

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
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.

839 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