![]() |
In CXTTabCtrl, How to Show (or) Hide a view |
Post Reply ![]() |
Author | |
A_K_N ![]() Newbie ![]() Joined: 20 March 2009 Location: India Status: Offline Points: 4 |
![]() ![]() ![]() ![]() ![]() Posted: 20 March 2009 at 1:32am |
I have a CXTTabCtrl. I have added two views to it.
m_xtTabs.AddView( "Pane 1", RUNTIME_CLASS(CProjectBrowserView), NULL, NULL, ID_PROJECT_BROWSER_VIEW, -1 ); m_xtTabs.AddView( "Pane 2", RUNTIME_CLASS(CActivityView), NULL, NULL, ID_ACTIVITY_VIEW, -1 ); Two views got added & it's also visible. I want to hide (or) show a view on click of a button. How can I do that? |
|
Thanks,
AKN |
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Hello,
You can remove it - DeleteView
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
A_K_N ![]() Newbie ![]() Joined: 20 March 2009 Location: India Status: Offline Points: 4 |
![]() ![]() ![]() ![]() ![]() |
Also please suggest is there a way to disable a view in CXTTabCtrl.
|
|
Thanks,
AKN |
|
![]() |
|
A_K_N ![]() Newbie ![]() Joined: 20 March 2009 Location: India Status: Offline Points: 4 |
![]() ![]() ![]() ![]() ![]() |
I thought to have it as the last option. (DeleteView)
CMFCTabCtrl has the way to Show (or) Hide a Tab using ShowTab(...) function. (By this way, I don't have to delete and recreate it again & again.) The problem in that is I'm unable to add views to it succesfully. CMFCTabCtrl has only AddTab function. So we need to create a view & add it. m_ProjectBrowserView.Create( NULL, "Pane 1", dwStyle, rectDummy, m_wndTabs, ID_PROJECT_BROWSER_VIEW); m_CurrentActivityView.Create( NULL, "Pane 2", dwStyle, rectDummy, m_wndTabs, ID_CURR_ACTIVITY_VIEW); m_wndTabs.AddTab(&m_ProjectBrowserView, csBrowserView, (UINT)0); m_wndTabs.AddTab(&m_CurrentActivityView, csActivityView, (UINT)1); But this crashes while closing. It's finding some problem during destroy window. But adding view in CXTTablCtrl is possible using AddView function. Also we are able to add view using RUNTIME_CLASS macro. Views creates using this way, doesn't find any problem. m_wndTabs.AddView( "Pane 1", RUNTIME_CLASS(CProjectBrowserView), NULL, NULL, ID_PROJECT_BROWSER_VIEW, -1 ); m_wndTabs.AddView( "Pane 2", RUNTIME_CLASS(CActivityView), NULL, NULL, ID_CURR_ACTIVITY_VIEW, -1 ); Now during closing of window, it's not crashing. That's why I'm looking towards using CXTTabCtrl for my application. Ideally it will good to have a Show (or) Hide a view in CXTTabCtrl as done in CMFCTabCtrl. |
|
Thanks,
AKN |
|
![]() |
|
A_K_N ![]() Newbie ![]() Joined: 20 March 2009 Location: India Status: Offline Points: 4 |
![]() ![]() ![]() ![]() ![]() |
Hi Oleg,
Can you suggest me any other control that can fit in to my requirement |
|
Thanks,
AKN |
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Hi,
You can try CXTPTabControl - it has option to show/hide tab but has not AddView - So copy thi s part from our sources.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |