Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing Static Label Text Dynamically 3

Status
Not open for further replies.

drizet

Programmer
Mar 26, 2001
6
US
I created a dialog box that resembles a prompt dialog box from Motif. In Motif, the label I created for the text edit box is an actual resource which can be changed dynamically. I use this feature so that the user knows which other control has activated the prompt dialog.

The only thing I found to simulate the label is a static text control. Can I chnage this label dynamically or do I need to create a non-user editable text box without a border?

Any help would be greatly appreciated.

Scott Urban
Sr. Software Engineer
Lockheed Martin Astronautics
email: david.s.urban@lmco.com or urban@ast.lmco.com
 
Hi

You can change the label text using the SetDlgItemText function.

Hope that helps.
 
Hello!

Your label Id = IDC_MYLABEL
Then:
GetDlgItem(IDC_MYLABEL)->SetWindowText("Testing my label");

 
Hi Scott,

Both of the Above are true.

Your Label ID = IDC_MYLABEL :

You can use
SetDlgItemText(IDC_LABEL, _T("My New Text Goes here"));
as well as
GetDlgItem(IDC_MYLABEL)->SetWindowText(_T("My New Text Goes here"));

Regards
Sun
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top