Results 1 to 7 of 7

Thread: Select All

  1. #1

    Thread Starter
    Fanatic Member kinjalgp's Avatar
    Join Date
    Apr 2000
    Location
    India
    Posts
    535
    How to select all the text in a text box? Can anyon please give me code for cut, copy and paste.


    Kinjal

  2. #2
    Frenzied Member
    Join Date
    Jun 2000
    Location
    East Providence, RI
    Posts
    1,715
    here you go:

    Code:
        Text1.SetFocus
        Text1.SelStart = 0
        Text1.SelLength = Len(Text1)
    NXSupport - Your one-stop source for computer help

  3. #3
    Guest
    To copy text:

    Code:
    Private Sub Command1_Click()
    Clipboard.Clear 
    Clipboard.SetText Text1.text
    End Sub
    To copy the selected text:

    Code:
    Private Sub Command1_Click()
    Clipboard.Clear
    If Text1.SelText <> "" Then
    Clipboard.SetText Text1.SelText
    Else
    End If
    End Sub
    To paste text:

    Code:
    Private Sub Command2_Click()
    Text1.text = ClipBoard.GetText()
    End Sub

  4. #4
    Guest
    To cut text:
    Code:
    Private Sub Command1_Click()
    Clipboard.Clear 
    Clipboard.SetText Text1.text
    Text1.Text = ""
    End Sub
    [/quote]

    To cut selection:
    Code:
    Private Sub Command1_Click()
    Clipboard.Clear
    If Text1.SelText <> "" Then
    Clipboard.SetText Text1.SelText
    Text1.SelText = ""
    Else
    End If
    End Sub

  5. #5
    Guest
    Cut and Copy are basically the same thing, except that when you cut, the text is cleared afterwards, whereas if you copy, than no text is cleared.

  6. #6
    Guest
    I know that, if you look at my code, you will discover that I do know that.

  7. #7

    Thread Starter
    Fanatic Member kinjalgp's Avatar
    Join Date
    Apr 2000
    Location
    India
    Posts
    535
    Thanks a lot!

    Kinjal

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