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 a vertical toolbar in visual c++

Creating a vertical toolbar in visual c++

Scheduled Pinned Locked Moved C / C++ / MFC
c++helptutorialquestion
5 Posts 2 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.
  • D Offline
    D Offline
    dneela
    wrote on last edited by
    #1

    Iam using CToolBar class. Here is the code. if (!m_pToolBar->CreateEx(this, WS_EX_RIGHT|TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP | CBRS_TOOLTIPS | CBRS_FLYBY CBRS_SIZE_FIXED | CBRS_ALIGN_RIGHT, CRect(0, 0, 0, 0), IDR_TOOLBAR_TAGCOLUMNS/*, CIDs::GetID()*/) || !m_pToolBar->LoadToolBar(IDR_TOOLBAR_TAGCOLUMNS)) { return FALSE; } This is creating a horizontal toolbar. Can anybody help me how to create a vertical toolbar?

    S 1 Reply Last reply
    0
    • D dneela

      Iam using CToolBar class. Here is the code. if (!m_pToolBar->CreateEx(this, WS_EX_RIGHT|TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP | CBRS_TOOLTIPS | CBRS_FLYBY CBRS_SIZE_FIXED | CBRS_ALIGN_RIGHT, CRect(0, 0, 0, 0), IDR_TOOLBAR_TAGCOLUMNS/*, CIDs::GetID()*/) || !m_pToolBar->LoadToolBar(IDR_TOOLBAR_TAGCOLUMNS)) { return FALSE; } This is creating a horizontal toolbar. Can anybody help me how to create a vertical toolbar?

      S Offline
      S Offline
      santhoshv84
      wrote on last edited by
      #2

      Hi, In the CreateEx(...) use CBRS_LEFT or CBRS_RIGHT instead of CBRS_TOP. Your Toolbar will be vertical...

      The price of anything is the amount of life you exchange for it. Thanks and Regards. SANTHOSH V

      D 1 Reply Last reply
      0
      • S santhoshv84

        Hi, In the CreateEx(...) use CBRS_LEFT or CBRS_RIGHT instead of CBRS_TOP. Your Toolbar will be vertical...

        The price of anything is the amount of life you exchange for it. Thanks and Regards. SANTHOSH V

        D Offline
        D Offline
        dneela
        wrote on last edited by
        #3

        Hi SANTHOSH, Thanks for ur reply. I tried with the styles u specified. but still the buttons in the toolbar are aligned horizontally, I want it to display vertically. What do I need to do for that? Thanks, Neela

        S 1 Reply Last reply
        0
        • D dneela

          Hi SANTHOSH, Thanks for ur reply. I tried with the styles u specified. but still the buttons in the toolbar are aligned horizontally, I want it to display vertically. What do I need to do for that? Thanks, Neela

          S Offline
          S Offline
          santhoshv84
          wrote on last edited by
          #4

          Hi, You better use this code..

           if (!m\_wndToolBar.CreateEx(this, TBSTYLE\_FLAT, WS\_CHILD | WS\_VISIBLE | CBRS\_TOP | CBRS\_GRIPPER | CBRS\_TOOLTIPS | CBRS\_FLYBY | CBRS\_SIZE\_DYNAMIC) || !m\_wndToolBar.LoadToolBar(IDR\_MAINFRAME))
          

          The price of anything is the amount of life you exchange for it. Thanks and Regards. SANTHOSH V

          D 1 Reply Last reply
          0
          • S santhoshv84

            Hi, You better use this code..

             if (!m\_wndToolBar.CreateEx(this, TBSTYLE\_FLAT, WS\_CHILD | WS\_VISIBLE | CBRS\_TOP | CBRS\_GRIPPER | CBRS\_TOOLTIPS | CBRS\_FLYBY | CBRS\_SIZE\_DYNAMIC) || !m\_wndToolBar.LoadToolBar(IDR\_MAINFRAME))
            

            The price of anything is the amount of life you exchange for it. Thanks and Regards. SANTHOSH V

            D Offline
            D Offline
            dneela
            wrote on last edited by
            #5

            Hi, I've used this code and after changing CBRS_TOP to CBRS_LEFT, it works fine. Thanks a lot!!! Regards, Neela.

            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