how do i know what is the current location of the cursor inside a richtextbox? something like [if i type] brown monkey is not me and the cursor is in m, i have 7. thanks...
Printable View
how do i know what is the current location of the cursor inside a richtextbox? something like [if i type] brown monkey is not me and the cursor is in m, i have 7. thanks...
One way , use MousePosition methods .
VB Code:
MousePosition.X MousePosition.Y
sorry for not clearing the things that i want. by the way pirate mate, thanks for the reply. i mean the blinking cursor inside richtextbox. something like if i have the brown monkey is not me text in the richtextbox and [say] if i have the cursor in the m of monkey, i can get the value 7. sort of 7th character. thanks
I see . Let me try to do you a demo!
i think this is it
is this the way mate? i don't know much about this. lol...VB Code:
dim i as integer=richtextbox1.selectionstart . . . richtextbox1.selectionstart=i
Yeah . You just put that code in the MouseDown or MouseUp events . It's up to you .
thanks so much pirate mate. :)
You solved your own problem . ;)
:bigyello: i've got another prob [related]. how do i get the current string where the cursor is located. say, brown monkey is not me text and the cursor is in m of monkey. i want to get the string monkey... :bigyello: