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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

set up and display intial text value in an edit box

Status
Not open for further replies.

ssdave

Programmer
Jul 8, 2002
9
0
0
US
I'm new to C++ programming and apologize for asking such a basic question, but how do you display, in an edit box on a dialog form, the contents of a variable into which you have read a line from a text file? Thanks in advance!
 
You can do 2 things:
1. Easiest: Use ClassWizard->Member Variables to assign a CString variable to the edit box you are using and then fill the string with the value you need.

2. "Api-est":Inside the dialog class, use SetDlgItemText method to set the text of the specified control.

In both cases, you should make use of these methods inside the DoDataExchange method. Be sure to check for the bSaveAndValidate flag of the CDataExchange pointer passed to the method.
If this is set to true, the method is called upon dialog initialization and you may set your text there.
If false, the method gets called upon dialog closing (or, if you want, for data validation).
[red]Nosferatu[/red]
We are what we eat...
There's no such thing as free meal...
once stated: methane@personal.ro
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top