Show/Hide controls in CDialog
Posted on 2007-03-19
I would like to place a button Hide Details on a CDialog derived dialog box which contains several controls. When the user presses the button, some of the controls are hidden and the dialog box is resized correspondingly. Button caption changes to Show Details. When the user presses the button, those hidden controls are shown and dialog box resizes back to original size.
For simplicity, you can assume that controls to hide take the whole line in the dialog so that the dialog is resized only vertically. At the same time, they are not necessarily located at the top or bottom of the dialog.
Please provide detailed code sample for showing/hiding controls and resizing dialog box on a button click event and OnInitDialog().