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

CXTPControlComboBox inside a CXTPToolBar

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


Joined: 01 February 2008
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote stringarray Quote  Post ReplyReply Direct Link To This Post Topic: CXTPControlComboBox inside a CXTPToolBar
    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?
Back to Top
stringarray View Drop Down
Newbie
Newbie


Joined: 01 February 2008
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote stringarray Quote  Post ReplyReply Direct Link To This Post Posted: 01 February 2008 at 12:21pm
Also, is there a way to put a regular MFC CComboBox in a CXTPToolBar? 
Back to Top
stringarray View Drop Down
Newbie
Newbie


Joined: 01 February 2008
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote stringarray Quote  Post ReplyReply Direct Link To This Post Posted: 01 February 2008 at 5:15pm
I found it!
you just call:
m_pNetToolBar->SetBarID(IDR_TOOLBAR_NETWORKINTERFACE);

Instead of "LoadToolbar".
Back to Top
tataxin View Drop Down
Newbie
Newbie


Joined: 22 May 2008
Location: United Kingdom
Status: Offline
Points: 8
Post Options Post Options   Thanks (0) Thanks(0)   Quote tataxin Quote  Post ReplyReply Direct Link To This Post 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.
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.