|
-
Apr 25th, 2001, 10:19 PM
#1
Thread Starter
Lively Member
MFC Dialog Box Question
okay, I have a bit of static text which I placed on a dialog box. I mapped the ID of the text to a CString. I would like to change the actual text when I press a command button.
i use:
m_strHandText = "SOME TEXT ID LIKE TO DISPLAY";
what do I now call to have that displayed at runtime in place of the current text displayed??
-
Apr 25th, 2001, 10:25 PM
#2
Thread Starter
Lively Member
okay i know i can use:
SetDlgItemText(ID_HAND_TEXT,"THE TEXT I WANT");
to accomplish this, but is there another way?
-
Apr 26th, 2001, 08:16 AM
#3
Frenzied Member
Why do you need another way
Try this
Code:
SetWindowText(handle, "text");
-
Apr 26th, 2001, 08:55 AM
#4
Monday Morning Lunatic
I think it's the UpdateData function...not totally sure
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Apr 26th, 2001, 11:21 AM
#5
When you said, "what do I now call to have that displayed at runtime in place of the current text displayed??", do you mean that you want to know how to have that text displayed when the app first runs and before the command button is pressed? That's unclear to me because you said, "now", after you described the command button technique.
This works when the app initializes:
In yourapp.cpp
In BOOL CYourappApp::InitInstance()
After CYourappDlg dlg;
put dlg.m_strHandText = "SOME TEXT ID LIKE TO DISPLAY";
If you meant, "how do I have the button update the text?", then in
void CYourappDlg::OnA_Command_Button()
put m_strHandText = "SOME TEXT ID LIKE TO DISPLAY";
or SetDlgItemText(ID_HAND_TEXT,"THE TEXT I WANT");
Please clarify.
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
|