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 Tech Support » How to Hide/Show the tab container? Collapse All
Subject Author Date
Chun Pong Lau May 23, 2010 - 10:20 PM

Dear sir,


After initialization, how can I hide/show the CExtTabPageContainerWhidbeyWnd?


Regards.


Chun Pong

Technical Support May 27, 2010 - 10:05 AM

You created the tab page container window as the main SDI view window because your tab page container uses the standard MFC’s AFX_IDW_PANE_FIRST dialog control identifier. The CFrameWnd window automatically detects its child window with the AFX_IDW_PANE_FIRST dialog control identifier and automatically shows is and positions it into the center area of the frame window.
This means you should use some other approach of hiding the tab page container window:

1) You can hide all its pages.

2) Or you can create some CWnd-based window as child of main frame window. This CWnd-based container window should use the AFX_IDW_PANE_FIRST dialog control identifier and the main frame window will automatically reposition it. Then you can created the tab page container window inside the CWnd-based container window. This layout will allow you to hide the tab page container window.

3) You can disable the tab page container window. It will be visible, but user will not be able to work with it.

Chun Pong Lau May 26, 2010 - 7:08 PM

I have created my tab page container under the class CMainFrame public CExtNCW < CFrameWnd >, public CExtDynamicBarSite{} with a member declaration:

CExtTabPageContainerWhidbeyWnd m_TabContainer;

and an initialization in CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)

m_TabContainer.Create(this, CRect(0,0,0,0), AFX_IDW_PANE_FIRST));

However, I cannot hide it by CFrameWnd::ShowControlBar(). If it executes:

ShowControlBar((CControlBar*)&m_TabContainer, FALSE, FALSE);

It will crash. Can you please advise?

Technical Support May 25, 2010 - 1:41 AM

A tab page container is just a regular window. You can show or hide it using CWnd::ShowWindow(). However if you create your tab page container inside a control bar, you should show or hide your control bar using the CFrameWnd::ShowControlBar() API. If you create your tab page container inside a dynamic control bar, you can show or hide it using the CExtDynamicControlBar::BarStateSet().