Re: A question in clipboard!
Then, right after the paste, do a Clipboard.Clear
That will clear everything currently stored in the clipboard.
If you don't want to do that, then you can encapsulate your paste code within an If statement to see if there is anything in the textbox already. If there is, then don't do the paste; if it is empty, do the paste.
Re: A question in clipboard!
Either clear the clipboard after you've pasted the text or have a check if the current clipboard text already have been pasted.
VB Code:
Private Sub Command1_Click()
Text1.SelText = Clipboard.GetText(vbCFText)
Clipboard.Clear
End Sub
VB Code:
Private Sub Command1_Click()
Static sLastText As String
Dim sTxt As String
sTxt = Clipboard.GetText(vbCFText)
If sTxt <> sLastText Then
Text1.SelText = sTxt
sLastText = sTxt
End If
End Sub
Re: A question in clipboard!
Quote:
Originally Posted by Hack
Then, right after the paste, do a Clipboard.Clear
That will clear everything currently stored in the clipboard.
If you don't want to do that, then you can encapsulate your paste code within an If statement to see if there is anything in the textbox already. If there is, then don't do the paste; if it is empty, do the paste.
First...Thx for your help :)
But if i use the if statement to see if there is anything in the textbox already..
and if there is i don't do the paste and if there is do the paste..
but what if i paste something in the text and then i copy something else!!!!!
that way the text is not empty so it won't do the paste :confused:
Re: A question in clipboard!
Quote:
Originally Posted by Shady Soft
First...Thx for your help :)
But if i use the if statement to see if there is anything in the textbox already..
and if there is i don't do the paste and if there is do the paste..
but what if i paste something in the text and then i copy something else!!!!!
that way the text is not empty so it won't do the paste :confused:
Ok, then if I'm reading you correctly, once you have it pasted in, you don't need it anymore, so just do the Clipboard.Clear and forget about the textbox check.