change dialog run time....

hello,
I have a dialog box which gets added to a property sheet using AddPages() function. There is one static text in dialog. one certain condition, i want to change its visibility to hidden at run time. How can i do this.
plz help me out.
thx.
[272 byte] By [sachin871] at [2007-11-19 22:04:59]
# 1 Re: change dialog run time....
also i have object of the class as

"m_oCConfigAboutKP"

using this, how can i access its member which is a static text on dialog.
sachin871 at 2007-11-10 23:35:02 >
# 2 Re: change dialog run time....
There is one static text in dialog. one certain condition, i want to change its visibility to hidden at run time.Are you trying to hide the text, or, the page? If its the text, use ShowWindow(). If it's the page, use RemovePage().
Mike Harnad at 2007-11-10 23:36:02 >
# 3 Re: change dialog run time....
Are you trying to hide the text, or, the page? If its the text, use ShowWindow(). If it's the page, use RemovePage().

hi mike,

The problem is...in both cases, i want to show the page. But once without the static text and once with static text. Is it possible? or i have to create two different dialog objects??
sachin871 at 2007-11-10 23:37:06 >
# 4 Re: change dialog run time....
hi mike,

The problem is...in both cases, i want to show the page. But once without the static text and once with static text. Is it possible? or i have to create two different dialog objects??

i think you are trying to do somthing like following?

CDialog* pDlg = &m_oCConfigAboutKP;

CStatic *pStatic = (CStatic*) pDlg->GetDlgItem(IDC_STATIC_MYTEXT);
pStatic->ModifyStyle() // I wonder it wud work? havent tested

pStatic->SetWindowText(""); //otherwise this shud work, without text
pStatic->SetWindowText("my test text"); //with text
jusstujoo at 2007-11-10 23:38:08 >
# 5 Re: change dialog run time....
I've never tried to add the same page twice. However, since CPropertySheet::AddPage() only requires a pointer to a CPropertyPage, it should work if you provide two different instances of the page.
Mike Harnad at 2007-11-10 23:39:07 >
# 6 Re: change dialog run time....
Yes,

we can hide and show a static text.
First change ID of that static text control to some id say ID_STATIC_MYCONTROL; add a variable for that static text control then use ShowWindow function with appropriate parameters
anand123 at 2007-11-10 23:40:00 >