Results 1 to 3 of 3

Thread: For Aaron Young or QWERTY:

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jun 1999
    Posts
    25

    Post

    ok, the code you gave me for copy was..

    SendKeys "^C", 1 'Copy

    now how do i use this?

    I have a textbox named Text1. And a command button named Command1. Now, if u can tell me how to code, so when i click the command button, it takes whats inside the textbox, and copies it. How do i do it? Thanks.

  2. #2
    Guru Aaron Young's Avatar
    Join Date
    Jun 1999
    Location
    Red Wing, MN, USA
    Posts
    2,177

    Post

    Method1:
    Code:
    Private Sub Command1_Click()
        Clipboard.SetText Text1.SelText
    End Sub
    Method2:
    Code:
    Private Sub Command1_Click()
        Text1.SetFocus
        SendKeys "^C", 1
    End Sub
    ------------------
    Aaron Young
    Analyst Programmer
    [email protected]
    [email protected]

  3. #3
    Fanatic Member
    Join Date
    Oct 1999
    Location
    MA, USA
    Posts
    523

    Post

    Put this codes into Click Event of a appropriate CommandButton:
    Code:
    Private Sub cmdCopy_Click()
        Clipboard.SetText Text1.SelText 'Copies only selected text
        'change Text1.SelText to Text1.Text if you want to copy whole TextBox
    End Sub
    
    Private Sub cmdCut_Click()
        Clipboard.SetText Text1.SelText
        Text1.SelText = ""
    End Sub
    ------------------
    Visual Basic Programmer
    -----------------
    PolComSoft
    You will hear a lot about it.

    [This message has been edited by QWERTY (edited 11-04-1999).]

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