Cursor position in RichEdit

G

gsb58

Hi!

I'm new to VB.NET

Anybody that could show me how to find the cursor position in a
RichEdit?

That is: when user click anywhere in the box and there's some text
already, I want to programatically move to a new line and insert time,
make a new line and user will be ready to insert new text.

I would appreciate if someone could show me how to count the amount of
words and place the caret/cursor at the actual point.

Happy programming!
 
C

Chris

Hi!

I'm new to VB.NET

Anybody that could show me how to find the cursor position in a
RichEdit?

That is: when user click anywhere in the box and there's some text
already, I want to programatically move to a new line and insert time,
make a new line and user will be ready to insert new text.

I would appreciate if someone could show me how to count the amount of
words and place the caret/cursor at the actual point.

Happy programming!

I don't know what a richedit is, but if you mean richtextbox then:

You need to look at RichTextBox.SelectionStart,
RichTextBox.SelectionLength, RichTextBox.SelectedText. These methods
return where the cursor is put, how long it is and what text is there.

Good Luck,
Chris
 
G

gsb58

Yeah, that's right!

I discovered some answers in the group seconds after posting. I say:
why not read FAQ or search the group BEFORE I post a question?

(Who knows....)

Anyway thanks a lot.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top