The information in this article applies to:
SYMPTOMSA control bar is not immediately visible after a call to Create. The control bar becomes visible only when the parent window is resized (or minimized\maximized). This behavior is true for all the built-in framework classes derived from CControlBar:
CAUSEA control bar is initially placed at position (0,0) with size (0,0) so that the parent frame can control the size and position. The size and position are recomputed when a call is made to RecalcLayout. If a call is made to Create, then the control bar will not become visible until RecalcLayout is called for the parent frame window. The control bar becomes visible when the main frame window is resized, because CFrameWnd has a WM_SIZE handler that calls RecalcLayout. RESOLUTION
Use one of the following to resolve this issue:
MORE INFORMATIONThere are two code segments below that show how to create a CDialogBar attached to a CMDIChildWnd. The first sample creates a CDialogBar as soon as the child window is created (that is, the child window always has the dialog bar). The second sample shows a function that will properly create and display a dialog bar at any time. Sample Code
Because you are allocating a CDialogBar object, you need to call delete
m_pDlgBar when you close the application or there will be a memory leak.
Additional query words: WM_SIZE CRect tool bar status tool-bar status-bar statusbar
Keywords : kbMFC KbUIDesign kbVC |
Last Reviewed: August 3, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |