Non-uniform width button in toolbar
-
Does anyone know how to have a button on a toolbar which is of a different width than the other buttons? I have tried using multiple toolbars, and that works, but does not give the result I want when the window is made resized small and then back large again. Thanks
-
Does anyone know how to have a button on a toolbar which is of a different width than the other buttons? I have tried using multiple toolbars, and that works, but does not give the result I want when the window is made resized small and then back large again. Thanks
You will need to derive your own class from CToolBar and override some of the functionality. Here are the notes from my code to fix the drop down arrow problem:
// From: MFC Knowlege base
// BUG: Resizing CToolbar with Dropdown Arrow Buttons Freezes Apps
// ID: Q190501// From: Microsoft Systems Journal (Aug98CQA.zip)
// Problem: When using TBSTYLE_EX_DRAWDDARROWS and TBSTYLE_DROPDOWN
// the right end of the toolbar gets cut off or if it is a
// vertical toolbar the bottom gets cut off.
// Fix: CalcSize()
//
// From: John R. Shaw (Me)
// Problem: If you only fix CalcSize() the sizing calculations are
// still wrong because WrapToolBar() uses the same invalid
// width value used in CalcSize().
// Fix: WrapToolBar()If you want I could zip up the code and send it to you. There is no garantee that it will solve your problem, but it would give you a good start. INTP
-
You will need to derive your own class from CToolBar and override some of the functionality. Here are the notes from my code to fix the drop down arrow problem:
// From: MFC Knowlege base
// BUG: Resizing CToolbar with Dropdown Arrow Buttons Freezes Apps
// ID: Q190501// From: Microsoft Systems Journal (Aug98CQA.zip)
// Problem: When using TBSTYLE_EX_DRAWDDARROWS and TBSTYLE_DROPDOWN
// the right end of the toolbar gets cut off or if it is a
// vertical toolbar the bottom gets cut off.
// Fix: CalcSize()
//
// From: John R. Shaw (Me)
// Problem: If you only fix CalcSize() the sizing calculations are
// still wrong because WrapToolBar() uses the same invalid
// width value used in CalcSize().
// Fix: WrapToolBar()If you want I could zip up the code and send it to you. There is no garantee that it will solve your problem, but it would give you a good start. INTP