Results 1 to 6 of 6

Thread: removing blinking cursor from text field

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2001
    Posts
    4

    removing blinking cursor from text field

    How can I remove the blinking cursor from a text field that my program is automatically updating? In other words, users won't be entering anything into the text field so how can I edit the text field so that there won't be a cursor inside of it?

    Thanks,
    Intaglio

  2. #2
    Junior Member
    Join Date
    Jun 2001
    Location
    Redcar, UK
    Posts
    24

    Re: Cursor

    I dont know how to take it away bar setting the focus to another control but why not just have the cursor at the end of the string in the field as soon as it updates, it look alright.



    Code:
    Text1.SelStart = Len(Text1.Text)
    Just an idea!
    "Three minutes thought would suffice to find this out; but thought is irksome and three minutes is a long time."


    "The supreme irony of life is that hardly anyone gets out of it alive."

  3. #3
    Addicted Member stevess's Avatar
    Join Date
    May 2001
    Posts
    251
    Text1.Locked = True

  4. #4

    Thread Starter
    New Member
    Join Date
    May 2001
    Posts
    4
    yeah locked=true was one of the first things I tried and the cursor still shows up in the field. If I do enabled=false it takes the cursor away but makes the font too light.

  5. #5
    Addicted Member stevess's Avatar
    Join Date
    May 2001
    Posts
    251
    Well you can always cheat, set enabled = false then set the forecolor = to whatever it was before that.

  6. #6
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    <?>

    Private Declare Function HideCaret _
    Lib "user32" ( _
    ByVal hwnd As Long) As Long

    Private Declare Function ShowCaret _
    Lib "user32" ( _
    ByVal hwnd As Long) As Long

    Private Sub Text1_GotFocus()
    HideCaret Text1.hwnd
    End Sub

    Private Sub Text1_LostFocus()
    ShowCaret Text1.hwnd
    End Sub
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width