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

Thread: WS_VISIBLE

  1. #1
    Join Date
    Mar 2001
    Posts
    45

    WS_VISIBLE

    How can you make a dialog control (button, combo, picture, etc.) appear and disappear at will.
    I created some pushbuttons which are initially
    NOT visible (so WS_VISIBLE is set to 0 in
    create) but couldn't see a way of making the control visible when I wanted to. The nearest
    I could see is EnableWindow but this requires the
    control to be visible in the first place.
    Is there a function which sets/unsets WS_VISIBLE
    or is it done in another way??

    Anwar




  2. #2
    Join Date
    Feb 2001
    Location
    Sydney, Australia
    Posts
    1,909

    Re: WS_VISIBLE

    Api version:

    ::ShowWindow(::GetDlgItem(hDlg, IDC_BUTTON1, SW_SHOWNORMAL); - show button
    ::ShowWindow(::GetDlgItem(hDlg, IDC_BUTTON1, SW_HIDE); - hide button

    MFC version:

    GetDlgItem(IDC_BUTTON1)->ShowWindow(SW_SHOWNORMAL); - show button
    GetDlgItem(IDC_BUTTON1)->ShowWindow(SW_HIDE); - hide button

    rate if it help you.

    Best regards,

    -----------
    Igor Soukhov (Brainbench/Tekmetrics ID:50759)
    igor_soukhov@yahoo.com | ICQ:57404554 | http://siv.da.ru
    Best regards,
    Igor Sukhov

    www.sukhov.net

  3. #3
    Join Date
    Oct 2000
    Location
    India
    Posts
    4,620

    Re: WS_VISIBLE

    Hi,

    You can use ShowWindow(SW_HIDE) and ShowWindow(SW_SHOW) to hide and show your controls.

    [b]If the answer REALLY helps and if you want to, you can Rate it.
    Visit http://www.geocities.com/contactgirish/homepage.html for some VC++ Links & Notes.All Luck,
    V.Girish
    All luck and have a great day.

    Regards,
    V.Girish

    Visit www.geocities.com/contactgirish for Source code, Tutorials, FAQs and Downloads.

  4. #4
    Join Date
    Jun 2001
    Location
    Lewes, UK
    Posts
    1,313

    Re: WS_VISIBLE

    Use ShowWindow();

    e.g.

    m_cMyButton.ShowWindow(SW_HIDE);




  5. #5
    Join Date
    Jun 2001
    Location
    Russia
    Posts
    49

    Re: WS_VISIBLE

    Try to use the code like this:

    GetDlgItem(IDC_BUTTON1)->ShowWindow(SW_HIDE);

    In MSDN you may see some other parameters to send with ShowWindow


  6. #6
    Join Date
    Mar 2001
    Location
    Italy, Catania
    Posts
    286

    Re: WS_VISIBLE

    You can use:

    // if m_button is the associated variable to button
    m_button.ShowWindow(SW_SHOW/*or SW_HIDE*/);



    or, if you don't want use any member variable:

    ((CButton*)GetDlgItem(IDC_BUTTON1))->ShowWindow(SW_SHOW);



    Bye!
    Marco


    THANKS ARE WELCOME, RATINGS MUCH MORE!

  7. #7
    Join Date
    Mar 2001
    Posts
    45

    Re: WS_VISIBLE


    All systems go!

    Cheers, Anwar




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center