Setting cursor to show overwrite or insert mode

D

Developer

I use the RichTextBox and sometimes put it into overwrite mode.

I'd like the cursor to show whether its in overwrite or insert mode.

I often use
Cursor.Current = Cursors.WaitCursor
and therefore need to change the cursor to show the overwrite/insert mode in
such a way that when the Cursor.Current is reset after the need for the wait
cursor ends, the cursor resets to the overwrite cursor or insert cursor as
appropriate.

Thank for any help
 
G

Guest

I use the RichTextBox and sometimes put it into overwrite mode.

Me too.
I'd like the cursor to show whether its in overwrite or insert mode.

I'd prefer a change to the insertion caret instead of the mouse cursor.
Maybe a change from a vertical bar to a wider rectangle like in the good old
days. And I would like the rtb to handle it so I don't have to bother with
it. While MS is at it, they ought to expose an rtb property that indicates
if the rtb is in insert or overstrike mode. I'll be watching this post with
interest. Good luck to both of us.
 
D

**Developer**

AMercer said:
Me too.


I'd prefer a change to the insertion caret instead of the mouse cursor.

Me too. Guess I got confused thinking about the cursor.

In VB6 I used to change the mode with:
SendMessage(ControlRichTextBox1.Handle, User.WM_KEYDOWN, User.VK_INSERT,
&H510001)

SendMessage(ControlRichTextBox1.Handle, User.WM_KEYUP, User.VK_INSERT,
&HC0510001)

But it doesn't seem to work with .NET

Do you change it programiccally?
 
G

Guest

Do you change it programiccally?

No. I just tried a SendKeys.Send("{INS}") experiment that failed. I think
maybe it failed because of my error and/or the nature of the test program I
used. The documentation indicates that .Send or .SendWait ought to work for
you, so maybe it is worth a try. In my personal opinion, SendKeys is not
such a good idea, but maybe it will solve your problem. And there is still
no way that I know of to ask the rtb whether it is in insert or overstrike
mode.

Continuing to watch this post with interest.
 
D

**Developer**

Thanks but I have already tried it (actually {"INSERT"} as I remember) and
it didn't work. Thanks


AMercer said:
No. I just tried a SendKeys.Send("{INS}") experiment that failed. I
think
maybe it failed because of my error and/or the nature of the test program
I
used. The documentation indicates that .Send or .SendWait ought to work
for
you, so maybe it is worth a try. In my personal opinion, SendKeys is not
such a good idea, but maybe it will solve your problem. And there is
still
no way that I know of to ask the rtb whether it is in insert or overstrike

I think it always starts in Insert mode so you can keep track:

dim mInsert as boolean = True

...KeyUp
mInsert=Not mInsert
 

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