Invoking CTRL+C,X,V programatically

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi Guys,

I need to be able to perform cop/cut/paste in any textbox of the application
i have focus on USING a button (not key combination). how can I invoke the
^C, ^X and ^V programatically?

I tried something like:
Private Sub btnPaste_Click(ByVal sender As System.Object, ByVal e As _
System.EventArgs) Handles
btnPaste.Click
System.Windows.Forms.SendKeys.Send("^(v)")
End Sub

-Didn't work

Any idea?

Thanks!
 
I wouldn't bother with keystrokes..

Instead look at the System.Windows.Forms.Clipboard class and it's methods.
 
Ori :) said:
I need to be able to perform cop/cut/paste in any textbox of the
application
i have focus on USING a button (not key combination). how can I invoke the
^C, ^X and ^V programatically?

I tried something like:
Private Sub btnPaste_Click(ByVal sender As System.Object, ByVal e As _
System.EventArgs) Handles
btnPaste.Click
System.Windows.Forms.SendKeys.Send("^(v)")
End Sub

\\\
If TypeOf Me.ActiveControl Is TextBoxBase Then
DirectCast(Me.ActiveControl, TextBoxBase).Copy()
End If
///
 
Back
Top