473,602 Members | 2,846 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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+AnyAlphabe t", 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 6249
On Thu, 11 Sep 2003 12:25:24 +0530, "Gary" <ms****@microso ft.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+AnyAlphabe t", 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.c om...
On Thu, 11 Sep 2003 12:25:24 +0530, "Gary" <ms****@microso ft.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+AnyAlphabe t", 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
1459
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. First, almost all of my manipulations use the ALT key to browse through the different menus within a window. The problem is that I have found that using SendKeys() to send ALT+F or ALT+R has a different effect from typing ALT+F or ALT+R. This...
2
5689
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 in a table with headings for each column, so converting an Access report to a Word doc in RTF doesn't work because only the text is converted, not the table. What I have tried so far, with some success, is to write the report directly in Word....
0
1259
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 enter into that form), but SendKeys.Send doesn't seem to do anything. This is my code : int y = listBox1.Items.Count;
1
7712
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 sendkeys. I hate using SendKeys, but I am forced to use them. Anyway, I have written a function that will unprotect the VBA code in the current work book. It works about 60% of the time. For some reason it gets out of sync and the SendKeys don't...
6
31039
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 reason..?
0
1919
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 use a series of SendKey("{TAB}") commands to get to the correct input box on the webpage. Next I try to use the SendKey command to enter phrase to utilise, but all I get is another instance of the same webpage, not the result that I expect.
3
3739
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 effort to close the document currently open in QuarkXPress. However, it only works if I set a breakpoint on or shortly before the AppActivate
5
13013
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 textbox keypress event. I got the following error msg: {"SendKeys cannot run inside this application because the application is not handling Windows messages. Either change the application to handle messages, or use the SendKeys.SendWait...
0
1569
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 execute this application like. To run that application some shorcut key is there SendKeys.SendWait("(%)rs"); SendKeys.SendWait("{DOWN}"); SendKeys.SendWait("{TAB}"); SendKeys.SendWait("{ENTER}");
0
7993
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
8054
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6730
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
5867
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5440
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3944
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2418
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1510
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1254
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.