Is there a way in C++ to select all data in a control (TEdit), when the OnEnter event fires? If the user TAB's into the field all data is automatically selected, but if they click in the field the | cursor is simply inserted where they clicked, I would like to have the OnEnter select all text in the control, so the mouse click works as the TAB does.
I have already tried (to no avail):
FieldName->SelLength = FieldName->Text.Length();
I also tried the following 2 variations:
SendMessage(FieldName->Handle, EM_SETSEL, 0, -1);
SendMessage(FieldName->Handle, EM_SETSEL, 0, FieldName->Text.Length());
I use C++Builder v6 if that matters