Solved

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

Posted on 2007-04-04
3
305 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: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone 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

Suggested Solutions

Title # Comments Views Activity
Error when running VS apps 14 124
AGK (App Game Kit) to work with Window's Visual Studio 2013 (Community, C++) 4 355
template declaration 35 142
Need some help with listview limit text 20 112
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…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

828 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