SetFocus??
-
Hi, I have a Dialogbar with some edit control into it. I want to set the focus on the first one. The focus seem to work right because the caret appear in the first edit control but my text in the control is not selected. what am I doing wrong? I would like to have the text selected so that I could change my text into the control without having to delete it first. thanks for helping Mykel Everything's beautiful if you look at it long enough...
-
Hi, I have a Dialogbar with some edit control into it. I want to set the focus on the first one. The focus seem to work right because the caret appear in the first edit control but my text in the control is not selected. what am I doing wrong? I would like to have the text selected so that I could change my text into the control without having to delete it first. thanks for helping Mykel Everything's beautiful if you look at it long enough...
-
Hi, I have a Dialogbar with some edit control into it. I want to set the focus on the first one. The focus seem to work right because the caret appear in the first edit control but my text in the control is not selected. what am I doing wrong? I would like to have the text selected so that I could change my text into the control without having to delete it first. thanks for helping Mykel Everything's beautiful if you look at it long enough...
Are you calling
MyEdit.SetSel(0, -1);
? This should select the whole text content of your edit box. [EDIT]This is the same as calling::SendMessage(
(HWND) hWnd, // handle to destination window
EM_SETSEL, // message to send
(WPARAM) 0, // starting position
(LPARAM) -1 // ending position
);[/EDIT]
Who is 'General Failure'? And why is he reading my harddisk?!?
-
Hi, I have a Dialogbar with some edit control into it. I want to set the focus on the first one. The focus seem to work right because the caret appear in the first edit control but my text in the control is not selected. what am I doing wrong? I would like to have the text selected so that I could change my text into the control without having to delete it first. thanks for helping Mykel Everything's beautiful if you look at it long enough...
I have the same kind of problem ... when my editbox received the focus, I want to select all text in it.
ON_EN_SETFOCUS(CMbCoordEdit::IDC_EDIT2, OnSetfocusControl2)
...void CMbCoordCtrl::OnSetfocusControl2()
{
m_edit2.SetSel( 0, -1);
}That doesn't work when clicking in the editbox. Setting the selection manually from another function works, but not like that. any hints ? Thanks.
Maximilien Lincourt "Never underestimate the bandwidth of a station wagon filled with backup tapes." ("Computer Networks" by Andrew S Tannenbaum )