MFC Hide Control: Using ShowWindow Method

To make an MFC control not visible, you can use the ShowWindow method of the control object and set its parameter to SW_HIDE.

For example, let’s say we have an MFC dialog class called CMyDialog, which includes a button control named m_button. You can use the following code to make the button control invisible:

CMyDialog dlg;

dlg.m_button.ShowWindow(SW_HIDE);

This way, the button control can be set to invisible.

bannerAds