Toolbar Resizing
-
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
-
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
-
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)?
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
-
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
-
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
Try:
// change the toolbar size to accomodate the text m_wndToolBar.SetSizes (TOOLBAR_BUTTON_SIZE, TOOLBAR_BUTTON_IMAGE_SIZE);
-
Try:
// change the toolbar size to accomodate the text m_wndToolBar.SetSizes (TOOLBAR_BUTTON_SIZE, TOOLBAR_BUTTON_IMAGE_SIZE);
Thanks. One more question, how do I check toolbar buttons when using CToolBar instead of CToolBarCtrl? It doesn't have a CheckButton() function. -- Steve
-
Thanks. One more question, how do I check toolbar buttons when using CToolBar instead of CToolBarCtrl? It doesn't have a CheckButton() function. -- Steve
You can always get the underlying CToolbarCtrl and call its member functions.
-
You can always get the underlying CToolbarCtrl and call its member functions.
Is there a way i can check the items without mixing classes? -- Steve
-
Is there a way i can check the items without mixing classes? -- Steve
Err.. Have you actually read the MSDN docs? Get it, it's worth it, or go on the net to h
ttp://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, asCToolBar
are made from (or using) theCToolBarCtrl
. I suggest you go to the docs... you'll learn a heck lot more. :rose: -
Err.. Have you actually read the MSDN docs? Get it, it's worth it, or go on the net to h
ttp://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, asCToolBar
are made from (or using) theCToolBarCtrl
. I suggest you go to the docs... you'll learn a heck lot more. :rose: