VC中隐藏和显示IDC_STATIC

void CImageShowAndHideDlg::OnBnClickedButton1() //隐藏
{
 
    CWnd* pWnd = GetDlgItem(IDC_STATIC);
    pWnd->ShowWindow(SW_HIDE);
}
void CImageShowAndHideDlg::OnBnClickedButton2()//显示
{
    // TODO: 在此添加控件通知处理程序代码
    CWnd* pWnd = GetDlgItem(IDC_STATIC);
    pWnd->ShowWindow(SW_SHOW);//SW_SHOW表示显示(子)窗口
}

 

转载于:https://www.cnblogs.com/blogpro/p/11426834.html

你可能感兴趣的:(VC中隐藏和显示IDC_STATIC)