How to visible or available a Textbox in MFC ?

Discussion in 'MFC' started by zippor, Nov 21, 2006.

  1. zippor

    zippor New Member

    Joined:
    Nov 13, 2006
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    0
    I have a Textbox and a button.
    When my program run, the textbox's visible (default). After the button's clicked, the textbox changes status (available).
    How do i have to do? Thanks
     
  2. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,346
    Likes Received:
    382
    Trophy Points:
    83
    Do you mean invisible? Just call the ShowWindow(SW_HIDE) for the textBox window.
     
  3. zippor

    zippor New Member

    Joined:
    Nov 13, 2006
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    0
    Ya, it's mean invisible, but where to call ShowWindow(SW_HIDE)? ( both of the textbox and the button belongs to be dialog).
     
  4. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,346
    Likes Received:
    382
    Trophy Points:
    83
    If you have the DDX control of the text box then use that variable with . and ShowWindow function will be in the list.

    If not you can use the GetDlgItem function to get the hwnd and then CWnd from the hWnd and then call the ShowWindow for it
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice