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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Set cursor at the begining of the selection after EM_SETSEL

Status
Not open for further replies.

theotyflos

Programmer
Oct 15, 2000
132
GR
Hi group, I need some help with the EM_SETSEL message:

I have a text box like this:
[COLOR=black white]abcdefghijklmnopqrst [/color]

After I send a EM_SETSEL message with parameters 10, 16 it selects characters from "k" to "p":
[COLOR=black white]abcdefghij[/color][COLOR=white blue]klmnop[/color][COLOR=red blue]|[/color][COLOR=black white]qrst [/color] with the cursor left after the "p"

Is there any way that the cursor stays before the "k" ? like this:
[COLOR=black white]abcdefghij[/color][COLOR=red blue]|[/color][COLOR=white blue]klmnop[/color][COLOR=black white]qrst [/color]

I tried to reverse the parameters (16, 10) but nothing happens.

Thanks in advance.

Theophilos.

-----------

There are only 10 kinds of people: Those who understand binary and those who don't.
 
Forgot to say that this is a *single* line textbox.

After doing some search in msdn I found out that the order of the "start", "end" parameters are respected if the control has the *multiline* attribute.

So either I have to change the textbox to multiline or I'll have to wait for some answers :)

Theophilos.

-----------

There are only 10 kinds of people: Those who understand binary and those who don't.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top