Results 1 to 5 of 5

Thread: Textbox select

  1. #1

    Thread Starter
    Addicted Member hyousuf2's Avatar
    Join Date
    Dec 2004
    Location
    Dublin
    Posts
    226

    Textbox select

    i want a text box's text to get selected when it gets focus

  2. #2
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: Textbox select

    Correction.. This will do it.

    VB Code:
    1. Option Explicit
    2.  
    3. Private Sub Command1_Click()
    4.   Text1.SelStart = 0
    5.   Text1.SelLength = Len(Text1.Text)
    6.   text1.setfocus
    7. End Sub
    Last edited by dglienna; Mar 26th, 2005 at 01:59 AM.

  3. #3

    Thread Starter
    Addicted Member hyousuf2's Avatar
    Join Date
    Dec 2004
    Location
    Dublin
    Posts
    226

    Re: Textbox select

    hi actually i tried to use these properties as well but couldnt something out of it
    can u explain the purpose of these as well !

  4. #4
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: Textbox select

    I figured it out.
    SelStart tells it where to start the selection
    SelLength tells it how long the string is (the length gets calculated)
    SetFocus HIGHLIGHTS it.

    It took a minute, but I figured it out.

  5. #5

    Thread Starter
    Addicted Member hyousuf2's Avatar
    Join Date
    Dec 2004
    Location
    Dublin
    Posts
    226

    Re: Textbox select

    just like dat
    thnkx alot

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