|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Invoking CTRL+C,X,V programaticallyHi 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. Show quoteHide quote "Ori :)" <O**@discussions.microsoft.com> wrote in message news:1D9888F9-208A-409A-8F1B-4CFF2ACD05CA@microsoft.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! > "Ori :)" <O**@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/>
Option Strict On
disabling controls by checking off a radio button when the form loads Can't close EXCEL from my VB.NET application Passing a Variable from one web site to another for ASP Currently logged in user's email SENDMail ContainsFocus equivalent in VB Get Memory Usage of my Program Double-Buffering in VB2005? save string var to html file without losing format |
|||||||||||||||||||||||