Software Archive
Read-only legacy content
17061 Discussions

Highlighting an item in an edit box

davidgraham
Beginner
563 Views
I am displaying a default item in an edit box.

The user wants to enter a new item, and so highlights it and types over it. How can I display the item already highlighted?

Thanks

David

Steve - Please sort out the forum so that the most recent postings are displayed at the top, or everybody will be giving their subject names as AAAAAAAAAAAA.... Better still give an option to sort by date or subject. It will soon become unmanagable as you will not see easily the new postings, so there will be less chance that people will respond to your postings.
0 Kudos
3 Replies
Intel_C_Intel
Employee
563 Views
Giving focus to the edit box should do it, no? (like if the user tabs to the edit box)

-John
0 Kudos
Jugoslav_Dujic
Valued Contributor II
563 Views
...or, more straight:

iSt=SendMessage(GetDlgItem(hDlg,IDC_EDITBOX), EM_SETSEL, 0, -1)

HTH

Jugoslav
0 Kudos
davidgraham
Beginner
563 Views
Using Set Focus only places the cursor in the edit box,
I had to use EM_SETSEL to highlight the text.

It's a pity with CVF that you have to know the answer before the help is any good.

Thanks.

David
0 Kudos
Reply