Print Page | Close Window

CFormView and CXTPToolBar

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=309
Printed Date: 11 May 2024 at 6:25am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: CFormView and CXTPToolBar
Posted By: JamesC
Subject: CFormView and CXTPToolBar
Date Posted: 18 December 2003 at 2:50pm
I have a CFormView with a Toolbar on it. I create it fine, but one of the buttons is supposed to be a ControlSplitButtonPopup. My Code looks like this:

VERIFY(m_wndToolBar.CreateToolBar(WS_VISIBLE|WS_CHILD|CBRS_T OOLTIPS, this, AFX_IDW_TOOLBAR)); //|CBRS_GRIPPER

VERIFY(m_wndToolBar.LoadToolBar(IDR_MY_TOOLBAR));

m_wndToolBar.SetFlags(xtpFlagAlignAny|xtpFlagFloating|xtpFla gStretched);//(xtpFlagStretched);

//More Options for Add

CXTPControl* pControl = m_wndToolBar.GetControls()->FindControl(xtpControlButton, ID_MY_TOOLBAR_ADD, TRUE, FALSE);

m_wndToolBar.GetControls()->SetControlType(pControl, xtpControlSplitButtonPopup);

I have a Menu with the same ID has the button 'ID_MY_TOOLBAR_ADD' but when I click on the arrow (which DOES show up next to the button that I want the arrow to be with), there is no menu. Am I missing a step. Normally it seems that this is all done in OnCreateControl but I dont get that message since I am only a CFormView. Any Ideas? Thanks




Replies:
Posted By: Oleg
Date Posted: 25 December 2003 at 12:48am

Try this:

 CXTPControl* pControl = m_wndToolBar.GetControls()->Add(xtpControlSplitButtonPopu p, ID_MY_TOOLBAR_ADD, _T(""), 0);



-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS



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