-
Feb 1st, 2016, 10:28 AM
#1
Thread Starter
Fanatic Member
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
-
Feb 1st, 2016, 11:07 AM
#2
Re: Duplicate Text when to use Copy and Past
Use Clipboard.Clear method before to use Clipboar.SetText
-
Feb 1st, 2016, 11:16 AM
#3
Thread Starter
Fanatic Member
Re: Duplicate Text when to use Copy and Past
Originally Posted by gibra
Use Clipboard.Clear method before to use Clipboar.SetText
Thank you , but no worked
-
Feb 1st, 2016, 11:24 AM
#4
Re: Duplicate Text when to use Copy and Past
Originally Posted by mutley
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|