Print Page | Close Window

CXTToolBar in a CFormView

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=11
Printed Date: 19 April 2024 at 3:53pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: CXTToolBar in a CFormView
Posted By: spike
Subject: CXTToolBar in a CFormView
Date 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




Replies:
Posted By: kstowell
Date 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




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net