473,408 Members | 2,027 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,408 software developers and data experts.

How to trap "ctl + c" in key up event

I writing a WPF windows app in c# and want to determine if the user has
pressed the control key and the 'c' key at the same time similar to the
standard windows 'copy' shortcut keys. How would I go about this?

Thanks.

--
mo*******@noemail.noemail
Feb 28 '07 #1
2 1612
Hi,

Thank you for posting here.

This is a quick note to let you know that I am researching on this issue
and will get back to you ASAP. I appreciate your patience.
Sincerely,
Linda Liu
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

Feb 28 '07 #2
Hi,

Sorry for my delayed response.

To determine if the user has pressed the control key and the 'c' key at the
same time on a WPF window, we could subscribe the KeyDown event of the
window and check the pressed keys in the event handler.

The following is a sample.
public partial class Window1 : System.Windows.Window
{

public Window1()
{
InitializeComponent();
this.KeyDown += new KeyEventHandler(Window1_KeyDown);
}

void Window1_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyboardDevice.Modifiers == ModifierKeys.Control && e.Key
== Key.C)
{
MessageBox.Show("You have pressed Ctrl+C.");
}
}
}

Hope this helps.
If you have any question, please feel free to let me know.

Sincerely,
Linda Liu
Microsoft Online Community Support

Mar 2 '07 #3

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

Similar topics

3
by: Kelly G. | last post by:
This question is regarding the setup, Is it possible to catch the event of the close button in the installation complete windows form dialog control(finished) , I basically need to point to...
13
by: MLH | last post by:
I'm thinking that maybe error trapping code could be in a global module (standard procedure) and a Master "OnError" statement could be set. Is anything like this in use with VBA for A97?
1
by: Sean Nolan | last post by:
We have implemented unhandled error trapping at the application level and log these errors to our database. One error, however, the does not get trapped is when the connection pool has exceeded the...
4
by: Lars Netzel | last post by:
Is there any way to add some code that will happen in every single Event that i raised in a form? I have a Total field in the bottom of a pretty complex page and I think it's kind of "Dirty" to...
3
by: Dale | last post by:
Access 2000 I am trying to check the form to be sure that required fields are entered. For each required field (Control) I have set the tag property to "1". I am trying to loop through all...
1
by: Anjan Bhowmik | last post by:
I am getting this exception while binding data to Gridview. I have a control parameter that accepts a integer value from a TextBox. If i provide a invalid value, i get that exception. But can't...
0
by: =?Utf-8?B?QWFyb24=?= | last post by:
I want to create an alert to trap event Id 55 and 2000 by MOM. We have MOM 2005 with sql 2000 sp4. Could someone give me some advice how to create this - Aaron
1
by: atishrg | last post by:
Hello all, I am facing a problem,, that I am not able to trace a "OBJECT REFERENCE NOT SET TO AN INSTANCE OF AN OBJECT" EXCEPTION .... as I am using On error goto _Lable as soon as this...
1
by: =?Utf-8?B?c2lwcHl1Y29ubg==?= | last post by:
I have a assembly from a third party that exposes an Event I want to Trap the event and tie to a Method in a Class where I am consuming their assembly. The class is actually a UserControl How...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
0
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...

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.