Results 1 to 4 of 4

Thread: code for right click(mouse) then copy

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2002
    Location
    Philippines
    Posts
    877

    code for right click(mouse) then copy

    hi, what is the code of right click (mouse) then copy..

    example i have a Textbox the textbox contains word.. like for example

    TextBox: vbforums

    and i have a button COPY if press COPY then ill go to any textbox, i will right click (mouse) then u will see the paste button if i press the paste button i want the vbforums to display...

    thanks

  2. #2

  3. #3
    Fanatic Member paralinx's Avatar
    Join Date
    Jun 2005
    Location
    Michigan
    Posts
    987

    Re: code for right click(mouse) then copy

    what you would do is

    VB Code:
    1. Private Sub Text1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    2.     If Button = vbRightButton Then
    3.         'make a menu in the menu editor and call it here and make the menu not visible
    4.     End If
    5.    
    6. End Sub

    Or that too..

  4. #4
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758

    Re: code for right click(mouse) then copy

    Use the Clipboard object and set the desired text in the Command Button's Click event.

    VB Code:
    1. Private Sub cmdCopy_Click()
    2.     Clipboard.Clear
    3.     Clipboard.SetText Text1.Text, vbCFText
    4. End Sub

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