By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,534 Members | 943 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,534 IT Pros & Developers. It's quick & easy.

Invoking CTRL+C,X,V programatically

P: n/a
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!

Apr 1 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
I wouldn't bother with keystrokes..

Instead look at the System.Windows.Forms.Clipboard class and it's methods.

"Ori :)" <Or*@discussions.microsoft.com> wrote in message
news:1D**********************************@microsof t.com...
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!

Apr 1 '06 #2

P: n/a
"Ori :)" <Or*@discussions.microsoft.com> schrieb:
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
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Apr 1 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.