When I move to a CEdit control on my dialog using the tab key or the arrow keys all the text in the control is selected. This behaviour is causing me problems and I would prefer it if the control just put the cursor at the start (or end) of the text and didn't select anything. Is there a simple way to do this (e.g. a property of the control that I can set)?
+1
A:
I don't think that such a style exists.
But you can add OnSetfocus handler with the wizard:
void CMyDlg::OnSetfocusEdit1()
{
CEdit* e = (CEdit*)GetDlgItem(IDC_EDIT1);
e->SetSel(0); // <-- hide selection
}
Nick D
2010-01-02 19:07:32