The information in this article applies to:
SUMMARY
Fix2lBar.exe is a sample that show how to correct CToolBar's behavior. The
original CToolBar, relying only on early releases of the common controls,
does not behave intuitively whenever it contains two or more consecutive
separators and it has vertical orientation. This behavior is even more
striking when the toolbar has the new TBSTYLE_FLAT style.
MORE INFORMATIONThe following files are available for download from the Microsoft
Download Center. Click the file names below to download the files: http://www.microsoft.com/downloads/search.aspand then click How to use the Microsoft Download Center.
The sample contains an AppWizard-generated SDI application, and implements
a CToolBar-derived class that implements the necessary fixes. The solution
relies basically on adding the new style CCS_VERT to the toolbar when it
must display more than just one row of buttons. In addition, the CalcSize()
and WrapToolBar() functions must be overridden. However, because these two
functions are not virtual, all CToolBar members that call these two
functions need to be copied and pasted in the new class, up to and
including the virtual functions CalcFixedLayout() and CalcDynamicLayout().
To illustrate the problem, the resource file has been edited to define the toolbar as:
You can experiment with both flat style toolbars and old style toolbars. To
do this, comment in and out the corresponding toolbar creation code in
CMainFrame::OnCreate().
NOTE: To use this fix on a Visual C++ 5.0 system, you need to add the two files, FixToolBar.h and FixToolBar.cpp, to a Visual C++ 5.0-generated project. Make sure you have the new common controls dll; add the corresponding new header (Commctrl.h and Commctrl.rh in DevStudio\VC\include directory) and lib files (Comctl32.lib in DevStudio\VC\lib) to your Visual C++ 5.0 installation. Additional query words: kbDSupport
Keywords : kbfile kbMFC KbUIDesign kbVC600 |
Last Reviewed: December 11, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |