Solved

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

Posted on 2007-04-04
3
309 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Enroll in June's Course of the Month

June's Course of the Month is now available! Every 10 seconds, a consumer gets hit with ransomware. Refresh your knowledge of ransomware best practices by enrolling in this month's complimentary course for Premium Members, Team Accounts, and Qualified Experts.

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…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

724 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