The information in this article applies to:
SUMMARYMFC's CToolBar class makes it easy to create floating toolbars that can dock to your window. Each time you run your application, these toolbars will be re-created in the default locations. This article shows how to override this behavior to save the toolbar positions and docking state and restore them the next time the application is executed. MORE INFORMATION
When you create a SDI or MDI MFC application with the AppWizard, you can
choose the Docking Toolbar option (default is selected). This option
creates a default toolbar that can float and has tooltips. It adds a
CToolBar member m_wndToolBar to the CMainFrame Class. It also adds code to
CMainFrame::OnCreate to create the toolbar and set its attributes.
This saves the docking state in the registry or .ini file under the
MyDockState profile entry.
LoadBarState must be called to reload the information and set the position of the controlbars next time the program is executed. This call has to be added to CMainFrame::OnCreate(). The following code illustrates this in the context of OnCreate:
REFERENCES
DOCKTOOL sample.
CFrameWnd::LoadBarState, Additional query words: 2.00 2.10 2.20 3.00 3.10 3.20 4.00 kbinf
Keywords : kbcode kbMFC KbUIDesign kbVC |
Last Reviewed: July 29, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |