Results 1 to 13 of 13

Thread: [RESOLVED] cursor in the textbox

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Feb 2007
    Location
    Malaysia
    Posts
    1,370

    Resolved [RESOLVED] cursor in the textbox

    I don't want cursor pointing/flashing in any of the textbox. How to do that?
    Attached Images Attached Images  

  2. #2
    PowerPoster Fazi's Avatar
    Join Date
    Aug 2005
    Location
    Underworld
    Posts
    2,525

    Re: cursor in the textbox

    is this your looking for
    Code:
    Private Sub Text1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    Me.Text1.MousePointer = 1
    End Sub

  3. #3
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: cursor in the textbox

    Look at the HideCarat API

  4. #4

    Thread Starter
    Frenzied Member
    Join Date
    Feb 2007
    Location
    Malaysia
    Posts
    1,370

    Re: cursor in the textbox

    I dont want have | in the textbox. Look at textbox6 "data tambahan" have this symbol | . Don't want this.How?

  5. #5
    PowerPoster Fazi's Avatar
    Join Date
    Aug 2005
    Location
    Underworld
    Posts
    2,525

    Re: cursor in the textbox

    Hack, That api should be called with in a timer , correct ?
    Code:
    Option Explicit
    Private Declare Function HideCaret Lib "user32" (ByVal hwnd As Long) As Long
    
    Private Sub Timer1_Timer()
    HideCaret Me.Text1.hwnd
    End Sub

  6. #6

    Thread Starter
    Frenzied Member
    Join Date
    Feb 2007
    Location
    Malaysia
    Posts
    1,370

    Re: cursor in the textbox

    It don't works. Still have | in the textbox.
    Attached Images Attached Images  

  7. #7
    PowerPoster Fazi's Avatar
    Join Date
    Aug 2005
    Location
    Underworld
    Posts
    2,525

    Re: cursor in the textbox

    No, the code i posted works well with my text box.
    attached.
    Attached Files Attached Files

  8. #8

    Thread Starter
    Frenzied Member
    Join Date
    Feb 2007
    Location
    Malaysia
    Posts
    1,370

    Re: cursor in the textbox

    Yes, it work.When I create my own, it doesn't work. Did you setting in your textbox?

  9. #9
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: cursor in the textbox

    Quote Originally Posted by Fazi
    Hack, That api should be called with in a timer , correct ?
    Code:
    Option Explicit
    Private Declare Function HideCaret Lib "user32" (ByVal hwnd As Long) As Long
    
    Private Sub Timer1_Timer()
    HideCaret Me.Text1.hwnd
    End Sub
    Put it in the GotFocus event of the textbox.

  10. #10

    Thread Starter
    Frenzied Member
    Join Date
    Feb 2007
    Location
    Malaysia
    Posts
    1,370

    Re: cursor in the textbox

    Quote Originally Posted by Hack
    Put it in the GotFocus event of the textbox.
    Yes, It works now when I put it in the gotfocus

  11. #11
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: [RESOLVED] cursor in the textbox

    In case you might need it for some future project, there is a corresponding ShowCarat API as well.

  12. #12

    Thread Starter
    Frenzied Member
    Join Date
    Feb 2007
    Location
    Malaysia
    Posts
    1,370

    Re: [RESOLVED] cursor in the textbox

    Thank you both of you

  13. #13
    PowerPoster Fazi's Avatar
    Join Date
    Aug 2005
    Location
    Underworld
    Posts
    2,525

    Re: [RESOLVED] cursor in the textbox

    But i am afride on the follwing seane.

    ok, assume you put that code on TextBox_Got Focus event.

    Now you click on the text box, so the caret will not be displayed.
    now you click another window i.e. task bar. now again you click your form to get back the focus. Now the caret will be shown on the text box

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