473,770 Members | 5,977 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

I need to capture the "Ctrl+F4" in widows application

Hi all

Just i want capture the with "Ctrl" (Key bord function) + any F1 or F4

In windows application How can capture the event in C# .net

Regards,
Venu
Nov 16 '05 #1
1 5778
Put this inside your Form class:

--<code>------------------------------------
protected override bool ProcessDialogKe y(Keys keyData)
{
switch (keyData)
{
case (Keys.Control | Keys.F4):
MessageBox.Show ("You pressed Crtl-F4");
return true; // Tell the caller that the key has been handled
case (Keys.Control | Keys.F1):
MessageBox.Show ("You pressed Crtl-F1");
return true;
};
// If the key hasn't been used by you then pass it to the base class
return base.ProcessDia logKey(keyData) ;
}
--<end code>------------------------------------

More reading here:
http://www.ondotnet.com/pub/a/dotnet...4/29/keys.html

regards, Teis

"karunakar" <ka***********@ stcroixsystems. com> wrote in message
news:%2******** **********@TK2M SFTNGP10.phx.gb l...
Hi all

Just i want capture the with "Ctrl" (Key bord function) + any F1 or F4

In windows application How can capture the event in C# .net

Regards,
Venu

Nov 16 '05 #2

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

Similar topics

2
7979
by: Paul Brady | last post by:
I have non-computer skilled users entering data into a form. There are certain ranges of values which, if they enter them, make no sense in the application, but I can't test them until they try to close out the form, in which case I can look at the entire set of values and see if they're OK. So, I have this code. for the "Before Update" event: if (their variables are inappropriate) then msgbox "You've entered bad variables (or some...
6
13035
by: daFritz | last post by:
Hi! I need to prevent Task-Switching in my App, so I tried to implement a low level keyboard hook in a extra class. But it seems that the Parameters are not passed correctly to my Hook function. Similar Examples in VB .NET work correctly. Heres the Source Code: using System; using System.Runtime.InteropServices;
0
339
by: karunakar | last post by:
Hi all Just i want capture the with "Ctrl" (Key bord function) + any F1 or F4 In windows application How can capture the event in C# .net Regards, Venu
7
2630
by: Michael Maes | last post by:
Hello, ALT+F4 is the shortcut to close a form. When I use this shortcut in an MDI enviroment, the application is closed, so obviously the shortcut applies to the 'Container' and not to the 'Childform'. What would be the best practice to capture this event and close the active child instead of the container (thus trying to end the application). --
5
3139
by: jcrouse | last post by:
I have an application thats a viewer. I also have a form that is fired from a Tools/Options menu selection. In the Options form the user can select a hotkey to use to exit the main viewer application. On the Options form I have a textbox that the user can use to enter the key he would like to use as the hotkey. I want to allow the hotkey to be letters, numbers and the control keys. When the textbox has focus and the user selects a letter...
2
1490
by: ApexData | last post by:
Hello In order to control keyboard keystrokes in my application, I use the KeyPreview=Yes, OnKeyDown Events of every Form with great success. HOWEVER, these events are not available in REPORTS, opening up my application to ALL Function/Ctrl/Alt keystrokes that a user can fire and cause problems. In STARTUP I have Use Access Special Keys set to OFF. I initially decided NOT to use the AutoKeys Macro, since it affects the entire app...
3
6002
by: Richard Lewis Haggard | last post by:
Is there an easy way to disable the hotkey sequence Control F4 or otherwise prevent the action from killing off MDI child windows in VS05/WinForms 2? I've already figured out how to get rid of the 'x' in the caption bar but the hot key sequence is still allowing users to kill off MDI child windows, which I need to prevent from happening. -- Richard Lewis Haggard www.Haggard-And-Associates.com
3
2531
by: =?Utf-8?B?QmlsbHkgWmhhbmc=?= | last post by:
I want to have following hotkey used in asp.net application, how to do this especially for F5? ESC F3 F4 F5 F6 F9 F10
1
1502
by: vasanthiraajan | last post by:
I need to capture the "Ctrl+F4" in widows application
0
9592
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...
0
9425
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10005
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
9871
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7416
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
5313
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5452
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3972
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
2
3576
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.