Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - CXTToolBar in a CFormView
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

CXTToolBar in a CFormView

 Post Reply Post Reply
Author
Message
spike View Drop Down
Groupie
Groupie


Joined: 13 May 2003
Location: United States
Status: Offline
Points: 48
Post Options Post Options   Thanks (0) Thanks(0)   Quote spike Quote  Post ReplyReply Direct Link To This Post Topic: CXTToolBar in a CFormView
    Posted: 13 May 2003 at 9:36am

I added the following code to a form view to add a toolbar to the top of the form...

int CProjectGenInfoFormView::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
     if (CProjectBASEFormView::OnCreate(lpCreateStruct) == -1)
         return -1;

    CImageList imageList;
     imageList.Create(16, 16, ILC_COLOR8 | ILC_MASK,  1, 0);

     m_wndToolBar.CreateEx(this, TBSTYLE_FLAT | TBSTYLE_LIST | TBSTYLE_TRANSPARENT,   WS_CHILD | WS_VISIBLE | CBRS_TOP | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);

     //AddButton is my own function, works ok

     m_wndToolBar.AddButton( 0, ID_PROJECTGENINFO_NEW, IDI_ICON1, "&New" );

     m_wndToolBar.MoveWindow( 2, 2, 400, 32 );

}

 

The problem is that the toolbar does not become enabled until the View is activated, once the view is deactivated the toolbar is deactivated. Is there a way to keep it activated at all times?

 

Thanks

Back to Top
kstowell View Drop Down
Admin Group
Admin Group


Joined: 25 January 2003
Location: MIchigan, USA
Status: Offline
Points: 496
Post Options Post Options   Thanks (0) Thanks(0)   Quote kstowell Quote  Post ReplyReply Direct Link To This Post Posted: 21 May 2003 at 10:43am

Hello,

Take a look at the FlatTabView sample project.  You need to create your toolbar as a child of the CMDIChildWnd for your view to do this correctly.  See CChildFrame::OnCreate for more details...hope this helps.

Best regards,
Codejock Support

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.516 seconds.