Suppose I have an editBox with text "this is edit",
and then I want to change that text to "second"
I think it is okay to code just like this:
m_edit1.SetWindowTextW(_T("this is edit"));
m_edit1.SetWindowTextW(_T("second"));
but I saw other program that they use like this:
m_edit1.SetWindowTextW(_T("this is edit"));
m_edit1.SetSel(0, -1, TRUE);
m_edit1.Clear();
m_edit1.SetWindowTextW(_T("second"));
My question is:
why they're using SetSel()
, Clear()
in this case if we can just overwrite it like first code example??