0

hi friends,

i would like to know how to highlight text in dialog's Edit box and List box.
Is there any mfc api for that ??

3
Contributors
12
Replies
13
Views
8 Years
Discussion Span
Last Post by __avd
0

i found the solution for highlighting text

1. SetFocus()
2. SetSel()

but i want to highlight multiple word ....can anybody help...

0

Selecting word is fine in my case can u help me for multiple selection i dont want go inside of gdi+

0

For example string in editbox is - Hi this is ashish!

and i want to select "is" and setsel() function takes position of start and end char to be selected.

m_CtlEdit.SetFocus()
m_CtlEdit.SetSel(5,7)
this is selecting first "is" - Hi this is ashish!

like that i tried for next
m_CtlEdit.SetSel(8,10)

but i want to select both "is" in same time..

0

if i do
m_CtlEdit.SetFocus()
m_CtlEdit.SetSel(5,7)
m_CtlEdit.SetSel(8,10)

then it is selecting the last one not both

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.