Disable tab

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! :)
tszwangAsked:
Who is Participating?
 
Laminamia063099Connect With a Mentor Commented:
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
 
vattalCommented:
0
 
tszwangAuthor Commented:
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
Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

 
Laminamia063099Commented:
Instead of using the above macros, you can use corresponding tab control messages: TCM_DELETEITEM, TCM_INSERTITEM.

Laminamia
0
 
kavorkaCommented:
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
 
Laminamia063099Commented:
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
All Courses

From novice to tech pro — start learning today.