regarding visibilty of controls
Well I have an application in which i need to control the visibilty of controls of a dialog box according to user choice,the dialog box itself is called whenever user clicks a menu,am able to display the menu and initially hide the controls ,but how can i make thier visibilty true thier.Also i have attached variables to each of the control using control wizard.......now what next???
plzzz help me
thnx...
Re: regarding visibilty of controls
ShowWindow() pasing SW_SHOW or SW_HIDE.
Re: regarding visibilty of controls
this showwindow function is used the dialog box ??But how can i use this function with the controls on dialog box......i dont need to hide my dialog box i only wish to make my controls of dialog box visible......also will i use the variable associated with control or the control name itself??
Re: regarding visibilty of controls
Quote:
Originally Posted by
pinnachio
this showwindow function is used the dialog box ??But how can i use this function with the controls on dialog box......i dont need to hide my dialog box i only wish to make my controls of dialog box visible......also will i use the variable associated with control or the control name itself??
1. ShowWindow can be used for any window.
2. Yes, you should create the control member variables for all the controls you are going to manipulate.
Re: regarding visibilty of controls
Quote:
But how can i use this function with the controls on dialog box......
All visible components are derived from CWnd... so you can use ShowWindow () on your dialog AND on all your child components that are on your dialog.
Re: regarding visibilty of controls
May be you have to use GetDlgItem(Control_ID)->ShowWindow(SW_HIDE or SW_SHOW) ;)
Hope this helps,
Thanks.:)
Re: regarding visibilty of controls
Quote:
Originally Posted by
LOOSER_007
May be you have to use GetDlgItem(Control_ID)->ShowWindow(SW_HIDE or SW_SHOW) ;)
Hope this helps,
Thanks.:)
No, neither OP nor you should use GetDlgItem, except for some rare cases (and this one does NOT belong to this exception).
Use control member variables!
Re: regarding visibilty of controls
Quote:
Originally Posted by
VictorN
No, neither OP nor you should use GetDlgItem, except for some rare cases (and this one does NOT belong to this exception).
Use control member variables!
Hi Victor,
Rare cases..??? Also i didn't get the reqirement over here(exception)...
why to use only control member variables...??? Just wanted to clarify.. as am also a beginner in MFC... :)
Thanks,