472,780 Members | 1,628 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,780 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 2759
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: Rina0 | last post by:
Cybersecurity engineering is a specialized field that focuses on the design, development, and implementation of systems, processes, and technologies that protect against cyber threats and...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: lllomh | last post by:
How does React native implement an English player?

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.