|
-
April 27th, 1999, 02:05 AM
#1
Making a control Visible
I have defaulted a CStatic control to NOT VISIBLE in the actual dialog. My problem is how do I make it visible again under program control, and then be able to make it invisible when I want to hide it again? I know, probably something really easy but, easy is one of those four letter words.
Thanks in advance!
John
-
April 27th, 1999, 02:13 AM
#2
Re: Making a control Visible
Change the Control ID to something other than IDC_STATIC, let's say IDC_STATIC_DESC. Now in ClassWizard, create a member variable of type control for IDC_STATIC_DESC, let's call it m_CtrlStDesc.
Now in the header file you'll have a public class member:
CStatic m_CtrlStDesc;
CStatic is derived from CWnd so it inherits all CWnd's member functions... the one you're looking for is CWnd::ShowWindow()
So to make the control visible:
m_CtrlStDesc.ShowWindow(SW_SHOW);
and to hide it:
m_CtrlStDesc.ShowWindow(SW_HIDE);
Hope that helps.
Rail
Recording Engineer/Software Developer
Rail Jon Rogut Software
[email protected]
http://home.earthlink.net/~railro/
-
April 27th, 1999, 02:21 AM
#3
Re: Making a control Visible
just put this code where you want.
CStatic *pStatic;
pStatic=(CStatic *)GetDlgItem(IDC_STATIC1);
pStatic->ShowWindow(SW_SHOW);
Is that what you want?. I hope so.
by nfuox
-
April 27th, 1999, 02:21 AM
#4
Re: Making a control Visible
Thanks for the input. I appreciate your tiome and effort. It worked great!
John
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|