For Ed: Newbie Question about populating a CEdit box 
Author Message
 For Ed: Newbie Question about populating a CEdit box

Hi Ed,

Not sure you saw this, so I reposted with the same title.

you can have two variables for your edit box item - just
as you described.  However, if you want to display a value
you compute in the box, you'll have to use the "value"
variable that you created for the dialog item.

For example, let's say I have a CDialog derived object
called CBogusDlg.  I have an edit box control, for which
I've created both a control variable, and a value variable.

the control will look like this:

CEdit m_BogusEditControl;

the value will look like this:

CString m_BogusEdit;

NOTE:  my example for the value variable assumes simple
text, thus the variable is type CString.  When you create
the value variable, make sure it is the type you need to
receive the value you are computing or otherwise creating.

To put the value you want in the box, set the value

m_BogusEdit = _T("My Bogus Data");

NOTE again:  my example here uses text.  The actual value
will depend on the type of variable you have created.

Once this is done, you can call  UpDateData(FALSE) to do
the data exchange.  The "FALSE" tells MFC that you want to
write the data out to the dialog.

I hope this is what you were looking for.


Sat, 21 Aug 2004 06:12:54 GMT  
 [ 1 post ] 

 Relevant Pages 

1. Newbie Question about populating a CEdit box

2. CEdit box ** CEdit box ** CEdit box

3. Help a Newbie: Acessing a CEdit box created w/ Dialoge Editor

4. Question about display in CEdit box

5. Question about setting the font type in CEdit box

6. CEdit Question (Newbie)

7. A real newbie question on CEdit

8. Easy Newbie Question: CEDIT backcolor

9. Question about CEdit inside dialog box

10. Runtime Control Question concerning coyping and pasting (CEdit, CCombo Box)

11. newbie questions: MFC controls (CEdit, ...) and CString

12. Bonehead newbie CEdit question.


Powered by phpBB® Forum Software