473,418 Members | 2,024 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,418 software developers and data experts.

Changing the blinking cursor in a TextBox

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
3 11887
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: malbanese | last post by:
I am building an ASP.Net application that occasionaly "stalls" while running a server side process like a large database update. During this tine the user does not get any feedback as to what is...
1
by: MrNobody | last post by:
How can I customize DataGrid so that when the mouse hovers over certain columns the cursor changes to the Cursors.Hand cusror? I was unable to use the MouseEnter/MouseLeave events on DataGrid...
1
by: Tomas Kepic | last post by:
Hi, how can I change default cursor to wait cursor in ASP? In Windows-Based Applications I'm using: Cursor.Current = System.Windows.Forms.Cursors.WaitCursor; How can I use something...
3
by: larry mckay | last post by:
does anyone have a code sample that changes the mouse cursor to an hourglass or waitcursor ? *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in...
2
by: Jim Frazer | last post by:
Hi, I'm working on an application in C# that will allow the user to create simple CAD drawings on a CEPC system. I would like to be able to change the cursor shape depending on the drawing mode...
0
by: =?Utf-8?B?Q29yZXlNY0s=?= | last post by:
I'm working on a TextBox control (in C# using .NET 2.0) that allows fields (like MS Office's mail merge feature). I want the editor to treat the field as though it was a single character. The user...
2
by: shammif2 | last post by:
hello all again. I'm still working with my text editor. now i want to get the cursor position in the richtext box. any way to do that?
0
by: Dom | last post by:
I need to change the cursor during certain events. The help screen seems to say to use the Cursor.Current property, but that seems to change the cursor for only a split second. Things work fine...
5
by: michels287 | last post by:
Right now I have a touchscreen with a virual keyboard. I would like to create arrow keys. If the user messed up the inputted text, he can move the blinking cursor left one space at a time between...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.