Adding ListControl and Controlling Visibility in ObjectARX MFC
The main objective is to implement a Button click to show the List below, creating a drawer-style menu tool.
This article aims to implement clicking on the toolbar to control the visibility of the List.
Reference:
Implementation of Hiding and Showing a Control in MFC
【MFC】Check if a control is hidden
In MFC, controls are searched and controlled using IDs, which is the same as the name in WPF and WinForm, operating by acquiring this control. The interface for controlling visibility is: ShowWindow(TRUE), and the interface for acquiring control state is: int bVisible = ((CWnd*)GetDlgItem(IDC_LIST1))->GetStyle() & WS_VISIBLE;
Main code:
- Initialize the List as hidden
1 | //----------------------------------------------------------------------------- |
- Display the specified List when the button is clicked
1 | void CMenuBarChildDlg::OnBnClickedButton1() |
All articles on this blog are licensed under CC BY-NC-SA 4.0 unless otherwise stated.



