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. Wrap toolbar to keep all buttons visible

Wrap toolbar to keep all buttons visible

Scheduled Pinned Locked Moved C / C++ / MFC
c++help
3 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.
  • S Offline
    S Offline
    s_k
    wrote on last edited by
    #1

    Hi all, I'm really tired of looking for the solution of this annoying problem: I have MFC application with CToolBar. In fact, I have CReBar and two CToolBars in it. I display few buttons with text in these toolbars (in single line). When user changes the size of main window and the width is not enough, I want toolbar to automatically wrap to more rows so that all buttons stay visible. I don't want to use chevrons or floating toolbars. I create my toolbars with TBSTYLE_WRAPABLE and I tried to call SetRows(...), but it had no effect. Yes, it created as many rows as requested, but all buttons stayed in the first row even though if the size was too small to show them all. Thank you all for any suggestion.

    R 1 Reply Last reply
    0
    • S s_k

      Hi all, I'm really tired of looking for the solution of this annoying problem: I have MFC application with CToolBar. In fact, I have CReBar and two CToolBars in it. I display few buttons with text in these toolbars (in single line). When user changes the size of main window and the width is not enough, I want toolbar to automatically wrap to more rows so that all buttons stay visible. I don't want to use chevrons or floating toolbars. I create my toolbars with TBSTYLE_WRAPABLE and I tried to call SetRows(...), but it had no effect. Yes, it created as many rows as requested, but all buttons stayed in the first row even though if the size was too small to show them all. Thank you all for any suggestion.

      R Offline
      R Offline
      Ravi Bhavnani
      wrote on last edited by
      #2

      I seem to recall that toolbar button wrapping only occured at separators. Does it wrap if you add a few separators? /ravi My new year's resolution: 2048 x 1536 Home | Articles | Freeware | Music ravib@ravib.com

      S 1 Reply Last reply
      0
      • R Ravi Bhavnani

        I seem to recall that toolbar button wrapping only occured at separators. Does it wrap if you add a few separators? /ravi My new year's resolution: 2048 x 1536 Home | Articles | Freeware | Music ravib@ravib.com

        S Offline
        S Offline
        s_k
        wrote on last edited by
        #3

        I tried that but no change. In fact, the toolbar gets wrapped when the size is too small, but it wraps to maximally 2 rows for me, although I call SetRows() with higher argument. Thus I think I'll have to get rid of it by writing my own code for wrapping the toolbar, since I haven't found any example on the web which uses toolbar wrapping for docked toolbar :sigh:

        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