Here is what I want to do:
I want to put text into the edit box of a combobox control, put the caret at the end of the field, NOT select the text and have the control gain the keyboard focus.
Here is what I have tried (wParam = handle to combobox)
All the above end up selecting the entire text, so the next key erases the text, which is exactly what I don't want to happen.
I am sure I am missing something obvious but darned if I know what it is.
Thanks,
MCM
I want to put text into the edit box of a combobox control, put the caret at the end of the field, NOT select the text and have the control gain the keyboard focus.
Here is what I have tried (wParam = handle to combobox)
Code:
SetWindowText wParam, szText ' but do not select? 'set caret at end of field (character # 8, zero based 'SendMessage wParam, %CB_SETEDITSEL, %NULL, MAKDWD(9%,9%) ' selecting all so is 8.8 'SendMessage wParam, %CB_SETEDITSEL, %NULL, MAKDWD(0%,0%) ' SendMessage wParam, %CB_SETEDITSEL, %NULL, MAKDWD(-1%,-1%) ' still selects SendMessage wParam, %CB_SETEDITSEL, %NULL, MAKDWD(-1%,8%) .. SetFocus wparam
I am sure I am missing something obvious but darned if I know what it is.
Thanks,
MCM
Comment