Dave's Brain

Browse - Programming Tips - How can I show/hide a windows control?

Date: 2017apr27
Platform: win32
Language: C/C++

Q.  How can I show/hide a windows control?

A.
void showHideControl(HWND hDlg, const int idCtrl, const bool bShow) { const int show = bShow ? SW_SHOW : SW_HIDE; ShowWindow(GetDlgItem(hDlg, idCtrl), show); }

Add a comment

Sign in to add a comment
Copyright © 2008-2017, dave - Code samples on Dave's Brain is licensed under the Creative Commons Attribution 2.5 License. However other material, including English text has all rights reserved.