How to gray out PropertyPage Tabs?
-
Hi, I have a CPropertySheet class object with several CPropertyPages in it. There are situations where I would need to prohibit the user from having access to a partiular PropertyPage. Is there a way to gray out that PropertyPage Tab to prevent it being selected? Thanks in advance, Jerry Wang
-
Hi, I have a CPropertySheet class object with several CPropertyPages in it. There are situations where I would need to prohibit the user from having access to a partiular PropertyPage. Is there a way to gray out that PropertyPage Tab to prevent it being selected? Thanks in advance, Jerry Wang
There's no flag or message for disabling tabs. You'll have to use owner-draw. Have a look at March 1998 issue of Microsoft Systems Journal, C++ Q & A column - it has the code you need. This article may be in your VC++ help; search in the 'Periodicals' section. If it's not there, go to msdn.microsoft.com, then MSDN Magazine and Past Issues. Tomasz Sowinski -- http://www.shooltz.com
-
Hi, I have a CPropertySheet class object with several CPropertyPages in it. There are situations where I would need to prohibit the user from having access to a partiular PropertyPage. Is there a way to gray out that PropertyPage Tab to prevent it being selected? Thanks in advance, Jerry Wang
And why don't remove the page? I don't Know if you can to prohibit the click in any tab. Try disabling the Dialog, that is part of the PropertySheet. Best Regards!!! Carlos Antollini.
-
Hi, I have a CPropertySheet class object with several CPropertyPages in it. There are situations where I would need to prohibit the user from having access to a partiular PropertyPage. Is there a way to gray out that PropertyPage Tab to prevent it being selected? Thanks in advance, Jerry Wang
I'm not sure if you can do it with EnableWindow or not. You can use RemovePage and AddPage but that probably isn't what you want. I hadn't thought about it but now I'm trying to find an example of a disabled property page.
-
And why don't remove the page? I don't Know if you can to prohibit the click in any tab. Try disabling the Dialog, that is part of the PropertySheet. Best Regards!!! Carlos Antollini.
It is not desirable to remove the page. I would like to let the user know that the features exists, but are only activated when the user checks a checkbox. I do not want the user to fiddle with the features inside the tab while having the checkbox unchecked and wondering why no action is happening. What is the function call to disable the dialog? I tried ShowWindow(FALSE) w/o success.:((
-
It is not desirable to remove the page. I would like to let the user know that the features exists, but are only activated when the user checks a checkbox. I do not want the user to fiddle with the features inside the tab while having the checkbox unchecked and wondering why no action is happening. What is the function call to disable the dialog? I tried ShowWindow(FALSE) w/o success.:((
The command is EnableWindow(); Cheers!!! Did you try with the article that said Tomasz??? Carlos Antollini.
-
The command is EnableWindow(); Cheers!!! Did you try with the article that said Tomasz??? Carlos Antollini.
Unfortunately VC++ doesn't like EnableWindow(FALSE) either. I just tried it in my CPropertySheet::OnInitDialog() and it gave me an run time assertion error. Apparently it is not a window and stops at
BOOL CWnd::EnableWindow(BOOL bEnable) { ASSERT(::IsWindow(m_hWnd)); ... }
where this == 0x01251ca0 and m_hWnd == 0x0 I will look into the article Tomasz mentioned. -
There's no flag or message for disabling tabs. You'll have to use owner-draw. Have a look at March 1998 issue of Microsoft Systems Journal, C++ Q & A column - it has the code you need. This article may be in your VC++ help; search in the 'Periodicals' section. If it's not there, go to msdn.microsoft.com, then MSDN Magazine and Past Issues. Tomasz Sowinski -- http://www.shooltz.com
Thank you Tomasz, I found the 1998 Q&A article. It is very helpful. Too bad the grayout feature is not implemented. I think what I'm gonna do is just have a pop-up window notifying the user noting the tab features are not activated and do a YES/NO/CANCEL to ask if he/she would like to activate it at this time. sigh, so much for wanting to make the program nice and neat :suss: Thanks Tomasz, thanks Carlos and Mike! Jerry
-
Thank you Tomasz, I found the 1998 Q&A article. It is very helpful. Too bad the grayout feature is not implemented. I think what I'm gonna do is just have a pop-up window notifying the user noting the tab features are not activated and do a YES/NO/CANCEL to ask if he/she would like to activate it at this time. sigh, so much for wanting to make the program nice and neat :suss: Thanks Tomasz, thanks Carlos and Mike! Jerry
Too bad the grayout feature is not implemented. "Not implemented?" What do you mean? The article presents the code that grays out and disables the tabs. Tomasz Sowinski -- http://www.shooltz.com
-
Unfortunately VC++ doesn't like EnableWindow(FALSE) either. I just tried it in my CPropertySheet::OnInitDialog() and it gave me an run time assertion error. Apparently it is not a window and stops at
BOOL CWnd::EnableWindow(BOOL bEnable) { ASSERT(::IsWindow(m_hWnd)); ... }
where this == 0x01251ca0 and m_hWnd == 0x0 I will look into the article Tomasz mentioned.Try it before or after OnInitDialog. It's not a window because at this point it hasn't been fully created yet.