How can I hide the cursor in a richTextBox?

Joined
May 20, 2006
Messages
7
Programming Experience
Beginner
Hello!

I've a richTextBox with the readOnly=True. But shows the text that I want with the typical cursor and seems that the user can write in it. Is it possible to hide this cursor?

Thanks in advance
 
Cannot hide the cursor

You cannot hide the cursor. If you have set the ReadOnly=True then it will not not let user write anything. But cursor blinking will appear by default. Alternatively you can set the property TabStop=False. Then cursor will not appear by default in Rich text Box. But if you click in the Rich Text Box the cursor wil blink. But it will not let user edit as you have set ReadOnly=True
 
I would just set the enabled property to false. This will not show the cursor in the box but it also changes the text to a gray color rather than black. Another thing you could do is use a label. If it's really important then have a label. I am not sure what exactly you need but I was just thinking the enabled property might help.
 
set the enabled property to false, then on the next line change the forecolor back to black and it'll be disabled but still look normal
 
*gag* hate API stuff *shake* why cant they just wrap EVERYTHING! then life would be simpler and we wouldnt need any sort of knowledge *ambiguous* dont suppose there is a site which gives a tutorial on using an API? which explaines EVERYTHING?
 
To be honest uncleronin i doubt there is a definitive way to make API work. 95% of the time it is trial and error, there are so many overloaded methods of nearly every API call to write them down would be extremely confusing.
 
It is easy to write a wrapper for API's and there are many written, I have a few myself. However; as vis781 has mentioned there are far too many and the flexibility and options are even more. So wrappers usually consist to a certain situation and modifying it is a hassle. That is why programmers usually prefer to use the API thereselves. Then again, if you find anyone building dll's for developers that consists of various situations for users then purchase and or give them credit and use it. It's alot of work and it for the most part, unless your really knowledgable (which I am not), like vis also said it is a lot of trial and error for a while. Then glitching comes as well. Using API's is great programming and if your not good at it and or never did it then make yourself do it. You will only get stronger using them. And your code will only open to endless possibilities.
 
stumbled across this thread and found a pretty simple solution to the problem.

set readonly to true and tabstop to false. and in the richtextbox's gotfocus event set focus onto something else.
 
Back
Top