Solved

Visual C++, setting "visible" parameter of a control

Posted on 2007-04-04
3
306 Views
Last Modified: 2007-04-04
Hi everybody,

I'm developping an application in C++ under Visual Studio 6.0.
I'd like to set dynamically (programatically) the "visible" parameter of a control, to set the control visible or not. (I'd like to show / hide controls dynamically)
Could anyone could help me?

Thank you very much for advance,
Vincent
0
Comment
Question by:vinceTrace
  • 2
3 Comments
 
LVL 44

Expert Comment

by:AndyAinscow
ID: 18850131
pWnd->ShowWindow(SW_SHOW);   //or SW_HIDE

pWnd is a pointer to the control (if you have it mapped to a control variable then use wnd. instead of pWnd-> )
0
 

Author Comment

by:vinceTrace
ID: 18850249
Thanks!
I've a varibale mapped to the control, and it works with pWnd...
CWnd* pWnd;
pWnd=GetDlgItem(IDC_BTNMYBTN);
pWnd->ShowWindow(SW_HIDE);

Is it right, or is there cases where it will not work?
0
 
LVL 44

Accepted Solution

by:
AndyAinscow earned 50 total points
ID: 18850441
That should be fine.  (As long as there is a control with that ID on the dialog/form)
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The following diagram presents a diamond class hierarchy: As depicted, diamond inheritance denotes when two classes (e.g., CDerived1 and CDerived2), separately extending a common base class (e.g., CBase), are sub classed simultaneously by a fourt…
In Easy String Encryption Using CryptoAPI in C++ (http://www.experts-exchange.com/viewArticle.jsp?aid=1193) I described how to encrypt text and recommended that the encrypted text be stored as a series of hexadecimal digits -- because cyphertext may…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

680 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question