Hello, i've encountered a problem with how to clear the entries in two edit boxes when a push button is clicked. I've tried the Clear() function but fails. Your feedback/help would be appreciated. Thanks.
Depending how you are using the edit controls e.g.
1. The controls are associated with tow CEdit objects:
CEdit m_edText2;
CEdit m_edText1;
then on your handler
void CMyView::OnButtonClear1()
{
m_edText1.SetWindowText(""
m_edText2.SetWindowText(""
}
Note that the DoDataExchage () should contains:
DDX_Control(pDX, IDC_EDIT1, m_edText1);
DDX_Control(pDX, IDC_EDIT2, m_edText2);
2. The edit box controls are associated with tow CString variables:
CString m_sLastName;
CString m_sFirstName;
Then the handler of the button when you want to reset should be :
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.