By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,667 Members | 2,603 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,667 IT Pros & Developers. It's quick & easy.

Changing the blinking cursor in a TextBox

P: n/a
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

Feb 21 '07 #1
Share this Question
Share on Google+
3 Replies


P: n/a
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

Feb 22 '07 #2

P: n/a
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
Feb 22 '07 #3

P: n/a
On Thu, 22 Feb 2007 14:34:34 +0000, Ph***********@foo.com wrote:
>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,
My mistake. Thanks for the correction.

rossum

Feb 22 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.