Urgently Need help to beginner's question
-
I am using the MFC dialog application. There are 3 edit box, add1, add2 and sum and a button "add", when exectuing, I input add1, add2, and use the "add" function dlg.m_sum=dlg.m_add1+dlg.m_add2 how to make the sum appears in the "sum" edit box? Do I have to add a view class or how to modify the OnPaint? I now only have add.cpp and addDlg.cpp
-
I am using the MFC dialog application. There are 3 edit box, add1, add2 and sum and a button "add", when exectuing, I input add1, add2, and use the "add" function dlg.m_sum=dlg.m_add1+dlg.m_add2 how to make the sum appears in the "sum" edit box? Do I have to add a view class or how to modify the OnPaint? I now only have add.cpp and addDlg.cpp
bloodwinner wrote:
I am using the MFC dialog application.
Then you're not using C++/CLI, are you ?
bloodwinner wrote:
dlg.m_sum=dlg.m_add1+dlg.m_add2
I assume you have associated ints with the text boxes, not edit controls ? Then you need to call UpdateData before you do the calculation, to bring down the variables, and UpdateData(FALSE) after the calculation, to populate the controls again. Or, maybe the other way around. Please ask in the right forum next time :-)
Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog