Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Creating ToolBar in a dialog

Creating ToolBar in a dialog

Scheduled Pinned Locked Moved C / C++ / MFC
question
7 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Muhammad Ahmed 0
    wrote on last edited by
    #1

    Hello Guys: i want to craete a tool bar in my dialog Box i am using following code in the OnInitDialog() .......... m_ToolBar.Create(this); m_ToolBar.LoadToolBar(IDR_TOOLBAR1); m_ToolBar.ShowWindow(TRUE); but i can't see any toolbar, any solutions?.. Thanks Muhammad Ahmed ahmed

    N R 2 Replies Last reply
    0
    • M Muhammad Ahmed 0

      Hello Guys: i want to craete a tool bar in my dialog Box i am using following code in the OnInitDialog() .......... m_ToolBar.Create(this); m_ToolBar.LoadToolBar(IDR_TOOLBAR1); m_ToolBar.ShowWindow(TRUE); but i can't see any toolbar, any solutions?.. Thanks Muhammad Ahmed ahmed

      N Offline
      N Offline
      n 0
      wrote on last edited by
      #2

      i guess you forgot to make it visible: VERIFY( m_toolbar.Create(WS_CHILD | WS_VISIBLE | CCS_NOPARENTALIGN | CCS_NORESIZE | TBSTYLE_FLAT | TBSTYLE_TOOLTIPS, CRect(XX, XX, XX, XX), this, AFX_IDW_TOOLBAR) );

      M 1 Reply Last reply
      0
      • N n 0

        i guess you forgot to make it visible: VERIFY( m_toolbar.Create(WS_CHILD | WS_VISIBLE | CCS_NOPARENTALIGN | CCS_NORESIZE | TBSTYLE_FLAT | TBSTYLE_TOOLTIPS, CRect(XX, XX, XX, XX), this, AFX_IDW_TOOLBAR) );

        M Offline
        M Offline
        Muhammad Ahmed 0
        wrote on last edited by
        #3

        i've used m_ToolBar.CreateEx(this,TBSTYLE_FLAT,WS_CHILD | WS_VISIBLE | CBRS_ALIGN_TOP, CRect(10,10,100,100), AFX_IDW_TOOLBAR); m_ToolBar.LoadToolBar(IDR_TOOLBAR1); m_ToolBar.ShowWindow(TRUE); but toolbar is invisible

        N 1 Reply Last reply
        0
        • M Muhammad Ahmed 0

          i've used m_ToolBar.CreateEx(this,TBSTYLE_FLAT,WS_CHILD | WS_VISIBLE | CBRS_ALIGN_TOP, CRect(10,10,100,100), AFX_IDW_TOOLBAR); m_ToolBar.LoadToolBar(IDR_TOOLBAR1); m_ToolBar.ShowWindow(TRUE); but toolbar is invisible

          N Offline
          N Offline
          n 0
          wrote on last edited by
          #4

          i've tested it. it works in my dialog. CListCtrl m_toolbar; m_toolbar.Create(WS_CHILD | WS_VISIBLE | CCS_NOPARENTALIGN | CCS_NORESIZE | TBSTYLE_FLAT | TBSTYLE_TOOLTIPS, CRect(0, 0, 100, 100), this, AFX_IDW_TOOLBAR); check if maybe sth in your program is on conflict with some of the styles.

          M 1 Reply Last reply
          0
          • N n 0

            i've tested it. it works in my dialog. CListCtrl m_toolbar; m_toolbar.Create(WS_CHILD | WS_VISIBLE | CCS_NOPARENTALIGN | CCS_NORESIZE | TBSTYLE_FLAT | TBSTYLE_TOOLTIPS, CRect(0, 0, 100, 100), this, AFX_IDW_TOOLBAR); check if maybe sth in your program is on conflict with some of the styles.

            M Offline
            M Offline
            Muhammad Ahmed 0
            wrote on last edited by
            #5

            u've used CListCtrl m_toolbar; i am using CToolBar m_ToolBar; ahmed

            N 1 Reply Last reply
            0
            • M Muhammad Ahmed 0

              u've used CListCtrl m_toolbar; i am using CToolBar m_ToolBar; ahmed

              N Offline
              N Offline
              n 0
              wrote on last edited by
              #6

              sorry, i'm still asleep. i've used CToolBarCtrl.

              1 Reply Last reply
              0
              • M Muhammad Ahmed 0

                Hello Guys: i want to craete a tool bar in my dialog Box i am using following code in the OnInitDialog() .......... m_ToolBar.Create(this); m_ToolBar.LoadToolBar(IDR_TOOLBAR1); m_ToolBar.ShowWindow(TRUE); but i can't see any toolbar, any solutions?.. Thanks Muhammad Ahmed ahmed

                R Offline
                R Offline
                Robert A T Kaldy
                wrote on last edited by
                #7

                You used CToolBar or CToolBarCtrl? In dialogs, you should use CToolBarCtrl. CToolBar is useful only in frame windows (only frame windows support docking) Robert-Antonio "Love without sex is like a fish without antlers"

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups