Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

select text

Status
Not open for further replies.

1362000

Technical User
Jul 31, 2005
10
0
0
IR
hi
how I can highlight a word in a textbox by api?
tanks
 
Send it a EM_SETSEL message, with the wParam set to the starting character and the lParam set to the ending character position.

Chip H.


____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
 
other thread said:
hi
i use sendmessage and EM_setsel message for select a chunk of a text in a text box.when i set start character and end character it selects from start to end of text(not the end character that i determined). how i can solve this problem
please help me
thanks
You'll see this behavior if you send it 0 and -1 for wParam and lParam. Check your variable datatypes and values.

Chip H.


____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
 
If you have CEdit control (MFC), directly use SetSel() member (see MSDN/compiler help on SetSel)...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top