Results 1 to 6 of 6

Thread: selecting text in a textbox

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2000
    Location
    UK
    Posts
    5

    Post

    When I click on a textbox created in a VB app, it behaves just like any other windows textbox.
    How do I make it so that with one single-click on the textbox, the whole contents of the textbox are selected?
    (This would be like the way the Address bar behaves in IE.)
    All help gratefully received.
    Thanks
    Steve

  2. #2

  3. #3
    Hyperactive Member Asaf_99's Avatar
    Join Date
    Jul 2000
    Location
    Israel
    Posts
    335
    I know the code is perfectl fine but for some reason it doesn't work for me!
    I use VB5 Enetrprize.
    Asaf Sagi

    ICQ: 61917199
    E-Mail: [email protected]

  4. #4
    Hyperactive Member Asaf_99's Avatar
    Join Date
    Jul 2000
    Location
    Israel
    Posts
    335
    I mean, it does but not when I click on a command button...
    Asaf Sagi

    ICQ: 61917199
    E-Mail: [email protected]

  5. #5
    Guest
    Code:
    Private Sub Command1_Click()
    
        Text1.SelStart = 0
        Text1.SelLength = Len(Text1.Text)
        Text1.SetFocus
        
    End Sub

  6. #6

    Thread Starter
    New Member
    Join Date
    Jul 2000
    Location
    UK
    Posts
    5

    Talking

    Thanks to all for your help
    The selStart and selLength method works fine.

    Steve

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