473,289 Members | 2,040 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,289 software developers and data experts.

SendKeys.Send("^(P)"); not working

I am trying to use the "System.Windows.Forms.SendKeys" class for triggering
the Ctrl+P key.

Syntax:
System.Windows.Forms.SendKeys.Send("^(P)");

This is not working ..what could be the reason..?

Situation:
I have a menu in my form, which is given a short key "Ctrl+P", now when the
form gets loaded, when I press the "Ctrl+P" then the menu functionality is
working. But the same thing I wanted to trigger on a button on click with
the following code..

System.Windows.Forms.SendKeys.Send("^(P)");

this is not working..

Note: Infact any of the "Ctr+AnyAlphabet", ie, Ctrl+A or..Ctrl+B..or
...C..like that is not working when using
System.Windows.Forms.SendKeys.Send("^(P)");
But the same thing is working fine, when I have as "Ctrl+AnyNumber", ie,
Ctrl+1 or Ctrl+2 with
System.Windows.Forms.SendKeys.Send("^(1)");
Nov 15 '05 #1
2 6202
On Thu, 11 Sep 2003 12:25:24 +0530, "Gary" <ms****@microsoft.com>
wrote:
I am trying to use the "System.Windows.Forms.SendKeys" class for triggering
the Ctrl+P key.

Syntax:
System.Windows.Forms.SendKeys.Send("^(P)");

This is not working ..what could be the reason..?

Situation:
I have a menu in my form, which is given a short key "Ctrl+P", now when the
form gets loaded, when I press the "Ctrl+P" then the menu functionality is
working. But the same thing I wanted to trigger on a button on click with
the following code..

System.Windows.Forms.SendKeys.Send("^(P)");

this is not working..

Note: Infact any of the "Ctr+AnyAlphabet", ie, Ctrl+A or..Ctrl+B..or
..C..like that is not working when using
System.Windows.Forms.SendKeys.Send("^(P)");
But the same thing is working fine, when I have as "Ctrl+AnyNumber", ie,
Ctrl+1 or Ctrl+2 with
System.Windows.Forms.SendKeys.Send("^(1)");


You must send this command to the correct form...

--
NULL

Nov 15 '05 #2
Thanks for the reply.
I got the solution.... the call is case-sensetive and hence the following
would work:

System.Windows.Forms.SendKeys.Send("^(p)");

- Gary -

"NULL" <Thomas-dot-Delrue-at-Tiscali-dot-Be> wrote in message
news:11********************************@4ax.com...
On Thu, 11 Sep 2003 12:25:24 +0530, "Gary" <ms****@microsoft.com>
wrote:
I am trying to use the "System.Windows.Forms.SendKeys" class for triggeringthe Ctrl+P key.

Syntax:
System.Windows.Forms.SendKeys.Send("^(P)");

This is not working ..what could be the reason..?

Situation:
I have a menu in my form, which is given a short key "Ctrl+P", now when theform gets loaded, when I press the "Ctrl+P" then the menu functionality isworking. But the same thing I wanted to trigger on a button on click with
the following code..

System.Windows.Forms.SendKeys.Send("^(P)");

this is not working..

Note: Infact any of the "Ctr+AnyAlphabet", ie, Ctrl+A or..Ctrl+B..or
..C..like that is not working when using
System.Windows.Forms.SendKeys.Send("^(P)");
But the same thing is working fine, when I have as "Ctrl+AnyNumber", ie,
Ctrl+1 or Ctrl+2 with
System.Windows.Forms.SendKeys.Send("^(1)");


You must send this command to the correct form...

--
NULL

Nov 15 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: David Kanter | last post by:
Hello, I have a question regarding SendKeys(). I am working on a small VB .Net script that manipulates/automates programs through SendKeys(). Unfortunately, I have run into several problems. ...
2
by: RBohannon | last post by:
I need to create a report in MS Word populated with data from A2K. I have been asked to create the report in Word so that parts of it can be edited as necessary later. The data in the report are...
0
by: dawn | last post by:
Hi, I'm trying to send input from one form into another in my c# app. I manage to make the form I'm trying to input to active (or at least I think so, cuz when I press keys on my keyboard they...
1
by: Bryan | last post by:
I am writing a C# Windows App that updates out Excel reports' modules. The app is complete, but has a problem. The only way MS allows you to unprotect the VBA code in Excel is to do it by hand or...
6
by: Gary | last post by:
Hi, I am trying to use the "System.Windows.Forms.SendKeys" class for triggering the Ctrl+P key. Syntax: System.Windows.Forms.SendKeys.Send("^(P)") This is not working ..what could be the...
0
by: Neil | last post by:
Can anyone tell me if there's a way to fillin a web form using SendKeys? I have written a program that uses Com Interop to create an instance of IE, and navigate to the correct webpage. Then I...
3
by: Phil Galey | last post by:
I have a VB.NET application that uses SendKeys to close the open document in QuarkXPress 5.0 I'm using the following commands: AppActivate(QXP_Process_ID) SendKeys.SendWait("^{F4}") in an...
5
by: =?Utf-8?B?U3JpbWFu?= | last post by:
Hi, We are launching .net window from vb6 form. In .net form tabbing(tab out from one control to another control) was not working. for that i have written a code like Sendkeys.send("{TAB}") in the...
0
by: jairathore | last post by:
Hi, I m working on a project on which my requirment is like that remotely i control another application by using sendkey.sendwait method, i m sending some keystroke to that application and...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.