共用方式為


CFrameWnd::SetMenuBarState

Sets the display state of the menu in the current MFC application to hidden or displayed.

virtual BOOL SetMenuBarState( 
    DWORD nState
);

Parameters

Parameter

Description

[in] nState

Specifies whether to display or hide the menu. The nState parameter can have the following values:

  • AFX_MBS_VISIBLE (0x01) – Displays the menu if it is hidden, but has no effect if it is visible.

  • AFX_MBS_HIDDEN (0x02) – Hides the menu if it is visible, but has no effect if it is hidden.

Return Value

true if this method successfully changes the menu state; otherwise, false.

Remarks

If a runtime error occurs, this method asserts in Debug mode and raises an exception derived from the CException class.

Requirements

Header: afxwin.h

See Also

Reference

CFrameWnd Class

Hierarchy Chart

CFrameWnd::GetMenuBarState

Other Resources

CFrameWnd Members