Solved

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

Posted on 2007-04-04
3
302 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
Comment Utility
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
Comment Utility
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
Comment Utility
That should be fine.  (As long as there is a control with that ID on the dialog/form)
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

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…
This video discusses moving either the default database or any database to a new volume.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

772 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

10 Experts available now in Live!

Get 1:1 Help Now