Home > Software engineering >  MFC edit box processing data
MFC edit box processing data

Time:12-09

I want to read in the two groups respectively using two edit boxes text data, and then two text data corresponding to the subtraction written to third in the edit box how to do? Hope to have bosses can give directions, thank!

CodePudding user response:

First of all, you can use the three edit box controls create edit box, and then set the attributes, for the three set the variable name edit box, variable types as integer variables, and then in the add a button control, written inside m_edit3=m_edit1 - m_edit2; The Update (FALSE); The m_edit1 here is the first edit box of a variable

CodePudding user response:

GetDlgItem (IDC_xx1) - & gt; GetWindowText (cstrings str1);
GetDlgItem (IDC_xx2) - & gt; GetWindowText (cstrings str2);
Cstrings str3;
Str3. The Format (" % d ", atoi (str1) - atoi (str2));
GetDlgItem (IDC_xx3) - & gt; SetWindowText (str3);
  • Related