CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 8 of 8

Hybrid View

  1. #1
    Join Date
    May 2009
    Posts
    88

    Post 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...

  2. #2
    Join Date
    Oct 2002
    Location
    Timisoara, Romania
    Posts
    14,360

    Re: regarding visibilty of controls

    ShowWindow() pasing SW_SHOW or SW_HIDE.
    Marius Bancila
    Home Page
    My CodeGuru articles

    I do not offer technical support via PM or e-mail. Please use vbBulletin codes.

  3. #3
    Join Date
    May 2009
    Posts
    88

    Post 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??

  4. #4
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,395

    Re: regarding visibilty of controls

    Quote Originally Posted by pinnachio View Post
    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

  5. #5
    Join Date
    Sep 2004
    Location
    Holland (land of the dope)
    Posts
    4,123

    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.

  6. #6
    Join Date
    Aug 2008
    Location
    India
    Posts
    186

    Re: regarding visibilty of controls

    May be you have to use GetDlgItem(Control_ID)->ShowWindow(SW_HIDE or SW_SHOW)

    Hope this helps,

    Thanks.

  7. #7
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,395

    Re: regarding visibilty of controls

    Quote Originally Posted by LOOSER_007 View Post
    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

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
  •  





Click Here to Expand Forum to Full Width

Featured