Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - In CXTTabCtrl, How to Show (or) Hide a view
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

In CXTTabCtrl, How to Show (or) Hide a view

 Post Reply Post Reply
Author
Message
A_K_N View Drop Down
Newbie
Newbie


Joined: 20 March 2009
Location: India
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote A_K_N Quote  Post ReplyReply Direct Link To This Post Topic: In CXTTabCtrl, How to Show (or) Hide a view
    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
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 20 March 2009 at 6:05am
Hello,
 
You can remove it - DeleteView
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
A_K_N View Drop Down
Newbie
Newbie


Joined: 20 March 2009
Location: India
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote A_K_N Quote  Post ReplyReply Direct Link To This Post Posted: 20 March 2009 at 6:12am
Also please suggest is there a way to disable a view in CXTTabCtrl.
Thanks,
AKN
Back to Top
A_K_N View Drop Down
Newbie
Newbie


Joined: 20 March 2009
Location: India
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote A_K_N Quote  Post ReplyReply Direct Link To This Post Posted: 20 March 2009 at 6:35am
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
Back to Top
A_K_N View Drop Down
Newbie
Newbie


Joined: 20 March 2009
Location: India
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote A_K_N Quote  Post ReplyReply Direct Link To This Post Posted: 21 March 2009 at 6:14am
Hi Oleg,

Can you suggest me any other control that can fit in to my requirement
Thanks,
AKN
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 23 March 2009 at 1:54am
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
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.203 seconds.