Hi everybody,
This is supposed to be really easy, but I can't get it to work. All I want to do is to automatically highlight the text in the text box when the user clicks on it. This needs to be just like using tab key.
Here is the procedure I use:
1) Create a text box and assign a control variable to it. (let's say m_cText)
2) I initialize the text in "OnInitDialog" by using
m_cTest.SetWindowText("Test"
3) I create a EN_SETFOCUS handler using class wizard.
4) I enter
m_cTest.SetSel(0,-1);
into the CEditBoxDlg::OnSetfocusEditFocus() function.
When I run the program, it doesn't work. Can you tell me what I am missing?
Thanks.
Mechy
This is supposed to be really easy, but I can't get it to work. All I want to do is to automatically highlight the text in the text box when the user clicks on it. This needs to be just like using tab key.
Here is the procedure I use:
1) Create a text box and assign a control variable to it. (let's say m_cText)
2) I initialize the text in "OnInitDialog" by using
m_cTest.SetWindowText("Test"
3) I create a EN_SETFOCUS handler using class wizard.
4) I enter
m_cTest.SetSel(0,-1);
into the CEditBoxDlg::OnSetfocusEditFocus() function.
When I run the program, it doesn't work. Can you tell me what I am missing?
Thanks.
Mechy