Click to See Complete Forum and Search --> : Changing Static Controls Text


May 19th, 1999, 01:48 AM
Hi All
I have a static control in a dialog box
I know I use SetDlgItemText(IDC_STATICITEM, CString str) to change a static items text
I would like to be able to change the static controls text from my main view class
I tried creating a static function that calls SetDlgItemText but developers studio says I can't call
SetDlgItemText from a static function
Any ideas how I could change a static controls text from my view class???
Thanks Alot

ric
May 19th, 1999, 04:29 AM
I am not sure what exactly you wanna do, but here is how I catch the meaning:

make a member var in the dialog class of type CString, and then do this:

in the view class --
CDialog MyDlg;
MyDlg.m_static_text = "What ever I want to";
MyDlg.DoModal();

in the InitDialog() of the dialog class
SetDlgItemText(IDC_STATIC1,m_static_text);