Results 1 to 4 of 4

Thread: Duplicate Text when to use Copy and Past

  1. #1

    Thread Starter
    Fanatic Member mutley's Avatar
    Join Date
    Apr 2000
    Location
    Sao Paulo - Brazil
    Posts
    709

    Question Duplicate Text when to use Copy and Past

    Hi

    When I tried to copy a Text from textbox (eg) It is duplicate text


    Example , in textbox there is "ABCDEF", when copy and Past in other textbox It past : ABCDEFABCDEF
    My code


    Code:
    'in form
    Private Sub mnuCopy_Click()
    
        Call lgEditCopyProc(Me.ActiveControl)
        Exit Sub
    End Sub
    
    
    'in library bas
    Sub lgEditPasteProc(pctl As Control)
     ' Place text from Clipboard into given control
      pctl.SelText = Clipboard.GetText()
    end sub
    
    
    Sub lgEditCopyProc(pctl As Control)
      ' Copy selected text to Clipboard
      Clipboard.SetText pctl.SelText
    end sub

  2. #2
    gibra
    Guest

    Re: Duplicate Text when to use Copy and Past

    Use Clipboard.Clear method before to use Clipboar.SetText

  3. #3

    Thread Starter
    Fanatic Member mutley's Avatar
    Join Date
    Apr 2000
    Location
    Sao Paulo - Brazil
    Posts
    709

    Re: Duplicate Text when to use Copy and Past

    Quote Originally Posted by gibra View Post
    Use Clipboard.Clear method before to use Clipboar.SetText
    Thank you , but no worked

  4. #4
    gibra
    Guest

    Re: Duplicate Text when to use Copy and Past

    Quote Originally Posted by mutley View Post
    Thank you , but no worked
    Sorry for you, but for me is work very good.

    Code:
    Sub lgEditCopyProc(pctl As Control)
        ' Copy selected text to Clipboard
        Clipboard.Clear
        Clipboard.SetText pctl.SelText
        DoEvents
        Label1.Caption = Clipboard.GetText ' to show what has been copied.
    End Sub

Tags for this Thread

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