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

x
?
Solved

Disable tab

Posted on 1999-07-19
6
Medium Priority
?
266 Views
Last Modified: 2013-11-20
May I know how to disable one of the tabs in a tab control? In other words, if I have four tabs inside a tab control, how can I disable one of them? :) Cheers! :)
0
Comment
Question by:tszwang
[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
6 Comments
 

Expert Comment

by:vattal
ID: 1310536
0
 

Author Comment

by:tszwang
ID: 1310537
Hi vattal,

Well, that is another control... do you know how to do it with the standard Tab control? Thank you very much in advance! :)
0
 
LVL 3

Accepted Solution

by:
Laminamia063099 earned 100 total points
ID: 1310538
int TabCtrl_DeleteItem ( hwndTabCtrl, itemIndex );

You can not "disable" a tab and still have it visible.  You must delete the item using the above macro and then add it later if you want it again using:

int TabCtrl_InsertItem(HWND hwnd,int iItem,const TC_ITEM FAR *pitem);      

If you wanted to disable the tab while it was still visible, that won't work with the standard tab control. Sorry.

Laminamia
 
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 3

Expert Comment

by:Laminamia063099
ID: 1310539
Instead of using the above macros, you can use corresponding tab control messages: TCM_DELETEITEM, TCM_INSERTITEM.

Laminamia
0
 

Expert Comment

by:kavorka
ID: 1310540
By disabling you want to make it appear disabled and then act disabled as well. Ther eis no built in way to do this. But by overrriding the click method of the tab control you can screen out switching to the tab, and by owner drawing you can make it look disabled. A lot of work for somethign that should really be built in. If the tab to disable is active when it becomes disabled, then you have to switch out of it or act accordingly.
0
 
LVL 3

Expert Comment

by:Laminamia063099
ID: 1310541
Kavorka is right.  Like I said, you can't disable it without deleting using the built in functions.  kavorka's thoughts on how to make it look and act disabled are intriguing, yet, as kavorka said, that's a lot of work for something that should be built in.
0

Featured Post

Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

Question has a verified solution.

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

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Ready to get certified? Check out some courses that help you prepare for third-party exams.
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.
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

722 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