Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS General Discussion » How to disable tab in the CExtTabWnd Application? Collapse All
Subject Author Date
Michael chang Mar 2, 2012 - 6:09 PM

Hi.


I’m implementing a Myskinable project like your skinable sample project using 2.87 library & VS2008. My application have several tabs. i need to change tab status enable to disalbe or disable to enable. But, It is not working properly.


Question 1. So, I add below code but it is not working. what’s problem?


//class CExtUITabWnd : public CExtTabWnd  


//CExtUITabWnd  m_wndMdiTabs;


   m_wndMdiTabs.ItemEnabledSet(1, false, TRUE);

   m_wndMdiTabs.ItemEnabledSet(2, false, TRUE);

   m_wndMdiTabs.ItemEnabledSet(3, false, TRUE);


 


Question 2. How to remove a caption of CExtDynamicControl bar dynamically.


My point is, I need a show/hide a caption(title bar) of CExtDynamicControlbar like your full screen state sample. 

mike dukes Oct 30, 2020 - 10:33 AM

Write code to handle the tab control’s SelectedIndexChanged event. This is the event that is raised when the user switches from one tab to the next.

Check credentials. Depending upon the information presented, you may want to check the user name the user has logged in with or some other form of credentials before allowing the user to view the tab.

If the user has appropriate credentials, display the tab that was clicked. If the user does not have appropriate credentials, display a message box or some other user interface indicating that they do not have access, and return to the initial tab.

Optionally, if you have more than two tab pages, display a tab page different from the original.


private void tabControl1_SelectedIndexChanged(object sender, System.EventArgs e)
{
// Check Credentials Here

if ((CredentialCheck.Checked == true) && (tabControl1.SelectedTab == tabPage2))
{
tabControl1.SelectedTab = tabPage2;
}
else if ((CredentialCheck.Checked == false) && (tabControl1.SelectedTab == tabPage2))
{
MessageBox.Show("Unable to load tab. You have insufficient access privileges.");
tabControl1.SelectedTab = tabPage3;
}
}

Technical Support Mar 4, 2012 - 1:03 PM

Answer 1. Only OneNote and Whidbey style tabs support disabled appearance of tab items.

Answer 2. This is not supported explicitly. The caption of control bar can be its window caption or caption of is parent tabbed bar window or caption of auto hide slider window or floating mini frame window caption. It just looks like the same caption. Control bars cannot be re-docked by used if they have no caption. The only reason to create caption-less bars is to use bars instead of splitters for creating complex splitter like window layouts with hide-able parts and UI state persistence. If you are using control bars instead of splitters, then you should simply create them using the CExtControlBar::Create() method invoked without the CBRS_GRIPPER style.