Results 1 to 8 of 8

Thread: Select text Backword

  1. #1

    Thread Starter
    Member
    Join Date
    Oct 1999
    Location
    Montreal
    Posts
    59

    This is to select a text forword
    Text2.SetFocus
    Text2.SelStart = 0
    Text2.SelLength = Len(Text2.Text)
    But this way (select a text back word):
    Text1.SetFocus
    Text1.SelStart = Len(Text1.Text)
    Text1.SelLength = 0
    it doesn't work !!

  2. #2
    Guest
    That's because you have it to select nothing.

    Code:
    Text2.SelLength = 0
    I am confused on what you want to do though.

  3. #3

    Thread Starter
    Member
    Join Date
    Oct 1999
    Location
    Montreal
    Posts
    59
    WEll when i use the code :
    Text2.SetFocus
    Text2.SelStart = 0
    Text2.SelLength = Len(Text2.Text)

    it will select the text form Left to Right and the cursor will be at the end,
    what i what to do is to select the text form Right to left
    so the cursor will be at the start !!: )

  4. #4
    Guest
    Something like this:

    Code:
    Private Sub Command1_Click()
        
        Text2.SetFocus
        Text2.SelStart = 0
        Text2.SelLength = Len(Text2.Text)
        Do
        Text2.SelLength = Text2.SelLength - 1
        DoEvents
        Loop Until Text2.SelLength = 0
        
    End Sub

  5. #5

    Thread Starter
    Member
    Join Date
    Oct 1999
    Location
    Montreal
    Posts
    59

    ahhh

    ahh man it doens't work
    But is it possible /


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

    <?>

    Code:
    'starts at beginning of text in textbox
    Private Sub Text1_GotFocus()
        Text1.SelStart = 0
    End Sub
    
    
    'starts at the end of text in textbox
    Private Sub Text2_GotFocus()
        Text2.SelStart = Len(Text1.Text)
    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

  7. #7

    Thread Starter
    Member
    Join Date
    Oct 1999
    Location
    Montreal
    Posts
    59
    I don't know about you guy's but it doen's work!!
    anyay is it possible ?

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

    <?>

    Of course it works...all you need is two textboxes
    Text1 and Text2 and then cut and copy the code.

    Perhaps you should post your code.
    "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