• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 233
  • Last Modified:

Edit Box Problem??.. Urgen... Really need help

Hi All smart experts:
  Now I try to edit a dialog box with 3 edit boxs to run a controller void function. I created a member function for ID_ok to execute the controller void function but I don't know how to let Edit Boxs to read int values to the 3 different int variables..working for this part long time... still not get it.....Really need help now.. PLease give me the code!!!  
                                            Moyea  
0
Moyea
Asked:
Moyea
1 Solution
 
kusamsonCommented:
when you design your dialog with the 3 edit boxes, you should be able to associate the edit controls with variables.  
Bring out the class wizard, under "member variable" tag, find the ID of your edit controls and add the variables.
You can set the variables to type int.

When you want to retrieve the data in the edit box, call UpdateData(TRUE),  the variables will get the values in the boxes.
0
 
BelfryCommented:
i don't know what did you mean, but i assume you want to assign values to edit boxes and get values from the edit boxes. you can use GetDlgItemInt() to get the values in integer and SetDlgItemInt() to set the value for the edit boxes.
//to get values in editboxes
int n1,n2,n3;
n1=GetDlgItemInt(IDC_EDIT1);
n2=GetDlgItemInt(IDC_EDIT2);
n3=GetDlgItemInt(IDC_EDIT3);
//use n1,n2,n3 for whatever purpose you like
//...

//to set values to editboxes
SetDlgItemInt(IDC_EDIT1,n1);
SetDlgItemInt(IDC_EDIT2,n2);
SetDlgItemInt(IDC_EDIT3,n3);
//...

enjoy:)
0
 
MoyeaAuthor Commented:
great job and ... it works
0

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now