On Thu, 22 Feb 2007 13:22:49 +0000, rossum <ro******@coldmail.com>
wrote:
>On 21 Feb 2007 09:09:20 -0800, fb*******@gmail.com wrote:
>>Hi, I'm quite new to C# allthough I've been programming in other
languages for quite a while.
I'd like to change the blinking cursor inside a TextBox, I guess I
must derive the class and override the OnPaint()-method, however I
have no clue what to do next. I want to be able to switch the blinking
cursor to a solid, non-blinking, cursor and preferable have it with a
color.
So, how should I do that?
Thanks
Have you tried the options in the TextBox.Cursor property?
Alternatively it is possible to construct your own Forms.Cursor object
and assign that to the TextBox.Cursor.
rossum
Need to get the right terminology:
Cursor = the pointer that moves when you move the mouse
Caret = the line/block/bitmap inside a control that usually indicates
the current insertion point. This is actually a Windows resource
shared among all applications (there is only ever 1 caret in existence
at any one time).
AFAIK controlling the caret has to be done via P/Invoke. I've never
had to do it but a google groups search for ".Net caret" brings up
some promising links, and if you change the help for Visual Studio so
that it is unfiltered and type "caret" into the search box on the
Index tab then you will find some hits in the MFC documentation which
should help.
Good luck,
--
Philip Daniels