-
June 4th, 2009, 06:33 AM
#1
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...
-
June 4th, 2009, 06:39 AM
#2
Re: regarding visibilty of controls
ShowWindow() pasing SW_SHOW or SW_HIDE.
-
June 4th, 2009, 06:45 AM
#3
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??
-
June 4th, 2009, 06:50 AM
#4
Re: regarding visibilty of controls
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.
Victor Nijegorodov
-
June 4th, 2009, 06:50 AM
#5
Re: regarding visibilty of controls
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.
-
June 4th, 2009, 07:45 AM
#6
Re: regarding visibilty of controls
May be you have to use GetDlgItem(Control_ID)->ShowWindow(SW_HIDE or SW_SHOW)
Hope this helps,
Thanks.
-
June 4th, 2009, 07:56 AM
#7
Re: regarding visibilty of controls
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!
Victor Nijegorodov
-
June 4th, 2009, 10:53 PM
#8
Re: regarding visibilty of controls
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,
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|