Playing Hide-the-Caret

R

randy

Hi,

I'm trying to set up a richtextbox to behave like the text
area in a web browser, i.e. no caret, and a cursor that
changes depending on what it's hovering over.

I've been setting the cursor by testing the "Selection"
properties of the text the cursor is over. This requires
setting the SelectionStart property, which causes the
caret to move. Ugh!

I tried using the user32.dll hideCaret function in an
attempt to remove the caret. This works inconsistently,
even when I place hideCaret calls all over the place.
Grrrr!

Is there an elegant solution to removing the caret?
Perhaps if I could control the caret color...

Any suggestions?

Randy
 
O

One Handed Man [ OHM# ]

This may help, I have not tested it on VB.NET

http://www.vb-helper.com/HowTo/nocaret.zip

Uses the HideCaret API function. Unfortunately, Visual Basic restores the
caret frequently. Subclass and hide the caret whenever the TextBox gets
message WM_PAINT or &H100E (whatever that is).

Regards - OHM
Hi,

I'm trying to set up a richtextbox to behave like the text
area in a web browser, i.e. no caret, and a cursor that
changes depending on what it's hovering over.

I've been setting the cursor by testing the "Selection"
properties of the text the cursor is over. This requires
setting the SelectionStart property, which causes the
caret to move. Ugh!

I tried using the user32.dll hideCaret function in an
attempt to remove the caret. This works inconsistently,
even when I place hideCaret calls all over the place.
Grrrr!

Is there an elegant solution to removing the caret?
Perhaps if I could control the caret color...

Any suggestions?

Randy

Regards - OHM# (e-mail address removed)
 

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