How can i hide Static Text in MFC ?
-
I tried following code but it working for Progess bar not for Static text. GetDlgItem(IDC_PROGRESS1)->ShowWindow(SW_SHOW); // Working GetDlgItem(IDC_STATIC)->ShowWindow(SW_SHOW); // Not working Kindly provide me solution...
-
I tried following code but it working for Progess bar not for Static text. GetDlgItem(IDC_PROGRESS1)->ShowWindow(SW_SHOW); // Working GetDlgItem(IDC_STATIC)->ShowWindow(SW_SHOW); // Not working Kindly provide me solution...
IDC_STATIC
as is won't work. you have to chage it to another name, likeIDC_STATIC**1**
...[VisualCalc][Binary Guide][CommDialogs] | [Forums Guidelines]
-
I tried following code but it working for Progess bar not for Static text. GetDlgItem(IDC_PROGRESS1)->ShowWindow(SW_SHOW); // Working GetDlgItem(IDC_STATIC)->ShowWindow(SW_SHOW); // Not working Kindly provide me solution...
The
IDC_STATIC
is default resource id provided for controls which are usually not accessed and manipulated. For instance, static texts, GroupBox etc. If you check the value ofIDC_STATIC
, you can see its-1
. So, if you want to manipulate that text control, as**toxcct**
said, change theIDC_STATIC
to some other name and access it. Or elseGetDlgItem()
will fail. Regards, Jijo._____________________________________________________ http://weseetips.com[^] Visual C++ tips and tricks. Updated daily.
-
The
IDC_STATIC
is default resource id provided for controls which are usually not accessed and manipulated. For instance, static texts, GroupBox etc. If you check the value ofIDC_STATIC
, you can see its-1
. So, if you want to manipulate that text control, as**toxcct**
said, change theIDC_STATIC
to some other name and access it. Or elseGetDlgItem()
will fail. Regards, Jijo._____________________________________________________ http://weseetips.com[^] Visual C++ tips and tricks. Updated daily.
-
Are you referring to the background color?
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
-
ramnathrn wrote:
can you tell me how to change the bback ground of label.
I guess you've asked "how to change the background color of label". :) Well, override the
CWnd::OnCtlColor()
in your dialog class. This function will be called for getting the control color of each child control. See here for more detailed description and code sample - http://msdn.microsoft.com/en-us/library/0wwk06hc(VS.80).aspx[^] Regards, Jijo._____________________________________________________ http://weseetips.com[^] Visual C++ tips and tricks. Updated daily.