Changing the blinking cursor in a TextBox

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • fbergroth@gmail.com

    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

  • rossum

    #2
    Re: Changing the blinking cursor in a TextBox

    On 21 Feb 2007 09:09:20 -0800, fbergroth@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

    Comment

    • PhilipDaniels@foo.com

      #3
      Re: Changing the blinking cursor in a TextBox

      On Thu, 22 Feb 2007 13:22:49 +0000, rossum <rossum48@coldm ail.com>
      wrote:
      >On 21 Feb 2007 09:09:20 -0800, fbergroth@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?
      >
      >Alternativel y 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

      Comment

      • rossum

        #4
        Re: Changing the blinking cursor in a TextBox

        On Thu, 22 Feb 2007 14:34:34 +0000, PhilipDaniels@f oo.com wrote:
        >On Thu, 22 Feb 2007 13:22:49 +0000, rossum <rossum48@coldm ail.com>
        >wrote:
        >
        >>On 21 Feb 2007 09:09:20 -0800, fbergroth@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?
        >>
        >>Alternative ly 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

        Comment

        Working...