Solved

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

Posted on 2007-04-04
3
304 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

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…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

943 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

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now