Results 1 to 2 of 2

Thread: Textboxes

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2010
    Posts
    1

    Textboxes

    How do I change the thing that blinks in text boxes (no idea what it is really called). IE: change it so it never blinks. Make it so it is not visible.

  2. #2
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: Textboxes

    Welcome to the forums.

    That thing is called the caret. You'll need the window handle of the textbox then use the following API to hide it.
    Code:
    Private Declare Function HideCaret Lib "user32.dll" (ByVal hWnd As Long) As Long
    Edited: If this textbox is in your form, suggest this (change Text1 to your textbox name)
    Code:
    Private Sub Text1_GotFocus()
        HideCaret Text1.hWnd
    End Sub
    You could disable the textbox instead; user won't be able to modify the contents. Locking the textbox still shows caret though one cannot change contents either. There may be other workarounds; but maybe describe why you don't want the user to see the caret when the textbox has focus?
    Last edited by LaVolpe; Jan 10th, 2010 at 11:01 PM.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

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