Print Page | Close Window

CXTPControlComboBox inside a 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=9470
Printed Date: 29 April 2024 at 11:05am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: CXTPControlComboBox inside a CXTPToolBar
Posted By: stringarray
Subject: CXTPControlComboBox inside a CXTPToolBar
Date Posted: 01 February 2008 at 12:11pm
Hello, I'm trying to put a CXTPControlComboBox inside a CXTPToolBar, by itself, with no buttons or other controls.

I did it so far with this:

m_pNetToolBar = ( CXTPToolBar* ) pCommandBars->Add(_T("Network"), xtpBarTop);
   
    if(!m_pNetToolBar || !m_pNetToolBar->LoadToolBar(IDR_TOOLBAR_NETWORK) )
    {
        TRACE0("Failed to create toolbar\n");
        return false;
    }
    m_cbNet = new CXTPControlComboBox();
   
    m_pNetToolBar->GetControls()->Add(m_cbNet, IDC_COMBO_NETWORK, i_L(""));



the problem is, when I call "LoadToolbar" using resource IDR_TOOLBAR_NETWORK, a toolbar with an empty button is loaded from resource, and I cannot delete that button from the resource toolbar because I get a message saying "empty toolbars not allowed". So I get a toolbar with a button and the combobox.

How do I create a toolbar with a combobox only?



Replies:
Posted By: stringarray
Date Posted: 01 February 2008 at 12:21pm
Also, is there a way to put a regular MFC CComboBox in a CXTPToolBar? 


Posted By: stringarray
Date Posted: 01 February 2008 at 5:15pm
I found it!
you just call:
m_pNetToolBar->SetBarID(IDR_TOOLBAR_NETWORKINTERFACE);

Instead of "LoadToolbar".


Posted By: tataxin
Date Posted: 26 June 2008 at 6:56am
I do the same, but it can not work with thi command:

m_cbNet = new CXTPControlComboBox();

How can you do that? where is m_cbNet declarated?
Thank you in advance.



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