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. Toolbar Resizing

Toolbar Resizing

Scheduled Pinned Locked Moved C / C++ / MFC
questionhelp
10 Posts 4 Posters 2 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
    Steven M Hunt
    wrote on last edited by
    #1

    I have a toolbar and am adding text labels to the buttons. The problem is that the toolbar is not sizing itself properly and the toolbar is still the size of a regular toolbar. How do I tell the toolbar to size properly? -- Steve

    J R 2 Replies Last reply
    0
    • S Steven M Hunt

      I have a toolbar and am adding text labels to the buttons. The problem is that the toolbar is not sizing itself properly and the toolbar is still the size of a regular toolbar. How do I tell the toolbar to size properly? -- Steve

      J Offline
      J Offline
      Jeff J
      wrote on last edited by
      #2

      Are you sending TB_AUTOSIZE to cause resizing of the toolbar, or sending TB_SETBUTTONSIZE before adding buttons? Also, are you using Win32, MFC, or WTL, and do you mean sizing verically (text below images) or horizontally (next to images)?

      S 1 Reply Last reply
      0
      • J Jeff J

        Are you sending TB_AUTOSIZE to cause resizing of the toolbar, or sending TB_SETBUTTONSIZE before adding buttons? Also, are you using Win32, MFC, or WTL, and do you mean sizing verically (text below images) or horizontally (next to images)?

        S Offline
        S Offline
        Steven M Hunt
        wrote on last edited by
        #3

        I'm using MFC and I need to resize the toolbar vertically. I am trying to create Internet Explorer-like buttons. I didn't have a problem in Win32, but MFC doesn't resize the toolbar automatically. -- Steve

        J 1 Reply Last reply
        0
        • S Steven M Hunt

          I'm using MFC and I need to resize the toolbar vertically. I am trying to create Internet Explorer-like buttons. I didn't have a problem in Win32, but MFC doesn't resize the toolbar automatically. -- Steve

          J Offline
          J Offline
          Jeff J
          wrote on last edited by
          #4

          So did you try sending the messages mentioned in my last post?

          1 Reply Last reply
          0
          • S Steven M Hunt

            I have a toolbar and am adding text labels to the buttons. The problem is that the toolbar is not sizing itself properly and the toolbar is still the size of a regular toolbar. How do I tell the toolbar to size properly? -- Steve

            R Offline
            R Offline
            Rand Althor
            wrote on last edited by
            #5

            Try: // change the toolbar size to accomodate the text m_wndToolBar.SetSizes (TOOLBAR_BUTTON_SIZE, TOOLBAR_BUTTON_IMAGE_SIZE);

            S 1 Reply Last reply
            0
            • R Rand Althor

              Try: // change the toolbar size to accomodate the text m_wndToolBar.SetSizes (TOOLBAR_BUTTON_SIZE, TOOLBAR_BUTTON_IMAGE_SIZE);

              S Offline
              S Offline
              Steven M Hunt
              wrote on last edited by
              #6

              Thanks. One more question, how do I check toolbar buttons when using CToolBar instead of CToolBarCtrl? It doesn't have a CheckButton() function. -- Steve

              R 1 Reply Last reply
              0
              • S Steven M Hunt

                Thanks. One more question, how do I check toolbar buttons when using CToolBar instead of CToolBarCtrl? It doesn't have a CheckButton() function. -- Steve

                R Offline
                R Offline
                Rand Althor
                wrote on last edited by
                #7

                You can always get the underlying CToolbarCtrl and call its member functions.

                S 1 Reply Last reply
                0
                • R Rand Althor

                  You can always get the underlying CToolbarCtrl and call its member functions.

                  S Offline
                  S Offline
                  Steven M Hunt
                  wrote on last edited by
                  #8

                  Is there a way i can check the items without mixing classes? -- Steve

                  R 1 Reply Last reply
                  0
                  • S Steven M Hunt

                    Is there a way i can check the items without mixing classes? -- Steve

                    R Offline
                    R Offline
                    Rand Althor
                    wrote on last edited by
                    #9

                    Err.. Have you actually read the MSDN docs? Get it, it's worth it, or go on the net to http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vcmfc98/html/_mfcnotes_tn031.asp Anyway, you won't be mixing classes. Here's a quote from those documentations: CToolBar::GetToolBarCtrl, a member function new to MFC 4.0, allows you to take advantage of the Windows common control's support for toolbar customization and additional functionality. CToolBar member functions give you most of the functionality of the Windows common controls; however, when you call GetToolBarCtrl, you can give your toolbars even more of the characteristics of Windows 95 toolbars. When you call GetToolBarCtrl, it will return a reference to a CToolBarCtrl object. See CToolBarCtrl for more information about designing toolbars using Windows common controls. For more general information about common controls, seeCommon Controls in the Windows 95 SDK Programmer’s Reference. Hope that helps. Essentially, there's no harm, as CToolBar are made from (or using) the CToolBarCtrl. I suggest you go to the docs... you'll learn a heck lot more. :rose:

                    T 1 Reply Last reply
                    0
                    • R Rand Althor

                      Err.. Have you actually read the MSDN docs? Get it, it's worth it, or go on the net to http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vcmfc98/html/_mfcnotes_tn031.asp Anyway, you won't be mixing classes. Here's a quote from those documentations: CToolBar::GetToolBarCtrl, a member function new to MFC 4.0, allows you to take advantage of the Windows common control's support for toolbar customization and additional functionality. CToolBar member functions give you most of the functionality of the Windows common controls; however, when you call GetToolBarCtrl, you can give your toolbars even more of the characteristics of Windows 95 toolbars. When you call GetToolBarCtrl, it will return a reference to a CToolBarCtrl object. See CToolBarCtrl for more information about designing toolbars using Windows common controls. For more general information about common controls, seeCommon Controls in the Windows 95 SDK Programmer’s Reference. Hope that helps. Essentially, there's no harm, as CToolBar are made from (or using) the CToolBarCtrl. I suggest you go to the docs... you'll learn a heck lot more. :rose:

                      T Offline
                      T Offline
                      Theo Buys
                      wrote on last edited by
                      #10

                      The link is out of date. I found the page with Google by enter "TN031 Control Bars".

                      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