473,387 Members | 1,516 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Cursor position in RichEdit

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!

Nov 21 '05 #1
2 2792
gs***@hotmail.com wrote:
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
Nov 21 '05 #2
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.

Nov 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: murlbrown | last post by:
I am using a class library built by michael kennedy that creates a system wide hook on the WH_KEYBOARD_LL, but I wanted to changed it to become a hook for a RichEdit box in another application. ...
1
by: Dan H. | last post by:
Hello, I want to try to retrieve the cursor position x and y relative to the form the cursor is over. The way I am doing it now is: 1. Retrieve the left and top position of the form relative...
1
by: Tantra Veda | last post by:
Hello C# gurus, I have a question about finding cursor position in NumericUpDown control. On my form I have a numericUpDown control with 2 decimal places. I want to increment value in the numeric...
1
by: Ilann | last post by:
Hi, I need to get the text cursor position in a richedit Control, ie I want my ContextMenu to appear exactly where the user is typing text, Thanks
1
by: objectref | last post by:
Hi to all, we have the MousePosition property that we can get the Point of the position of the mouse cursor on the screen, but is it there a way to get the respective Point of a cursor in a...
1
by: Patty O'Dors | last post by:
Hi I'm trying to create an application with a RichEdit control, I found that CreateWindow always returns a null hWnd unless I call LoadLibrary("riched20.dll") first (the error code from...
1
by: Paul | last post by:
Hi all, I am making a DirectInput application wich must report correctly the cursor position in windowed mode (it means it has to be the same as Microsoft Window´s cursor position). First of...
4
by: Stanley | last post by:
Hi all! Can somebody tell me how to customize the tab stop position in a rich text box? Just like we do in MS Word by clicking the ruler! I've been searching the web but I can't find the answer!...
4
by: mike | last post by:
I have the opportunity to rescue a project that uses a mouse to sense the relative position of a machine. The hardware is built...just needs to be programmed. Stop snickering!!! I didn't do it...I...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.