473,947 Members | 1,342 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to add a shortcut Ctrl+S ?

How to add a shortcut Ctrl+S ?

I want to add a new function for user to provide Ctrl+S to save things.
How can I do that?

Thanks

Charles Shao^_^
Nov 17 '05 #1
3 24005
Create a menu item "Save" under the appropriate mainmenu item such as "File".
In the design-view, click on this "Save" menu item. In the Properties window,
change the value of ShowShortcut to "True". Now, in the same properties
window, click on the property "Shortcut". In the right-side column, a small
button with a down-arrow appears. Click on that button, and from the options
offered, select "CtrlS" option. Now, in the event-handler for the said menu
item, put the neccesary code for the Save functionality. Build your
application. Now, you can use the Ctrl + S keys to directly save your
document.

"cyshao" wrote:
How to add a shortcut Ctrl+S ?

I want to add a new function for user to provide Ctrl+S to save things.
How can I do that?

Thanks

Charles Shao^_^

Nov 17 '05 #2
Thank you.

But it's a dailog form without menu.
How can I do this ?
"Ashok Dhamija" <As**********@d iscussions.micr osoft.com> дÈëÓʼþ
news:C8******** *************** ***********@mic rosoft.com...
Create a menu item "Save" under the appropriate mainmenu item such as "File". In the design-view, click on this "Save" menu item. In the Properties window, change the value of ShowShortcut to "True". Now, in the same properties
window, click on the property "Shortcut". In the right-side column, a small button with a down-arrow appears. Click on that button, and from the options offered, select "CtrlS" option. Now, in the event-handler for the said menu item, put the neccesary code for the Save functionality. Build your
application. Now, you can use the Ctrl + S keys to directly save your
document.

"cyshao" wrote:
How to add a shortcut Ctrl+S ?

I want to add a new function for user to provide Ctrl+S to save things.
How can I do that?

Thanks

Charles Shao^_^

Nov 17 '05 #3
Add the following code to your form to capture Ctrl + S:

private void <your_form>_Key Down(object sender,
System.Windows. Forms.KeyEventA rgs e)
{
if(e.KeyCode == Keys.S && e.Control)
MessageBox.Show ("Ctrl+S pressed");
}

Gabriel Lozano-Morán

"cyshao" <ad****@263.net > wrote in message
news:%2******** ********@TK2MSF TNGP10.phx.gbl. ..
Thank you.

But it's a dailog form without menu.
How can I do this ?
"Ashok Dhamija" <As**********@d iscussions.micr osoft.com> дÈëÓʼþ
news:C8******** *************** ***********@mic rosoft.com...
Create a menu item "Save" under the appropriate mainmenu item such as

"File".
In the design-view, click on this "Save" menu item. In the Properties

window,
change the value of ShowShortcut to "True". Now, in the same properties
window, click on the property "Shortcut". In the right-side column, a

small
button with a down-arrow appears. Click on that button, and from the

options
offered, select "CtrlS" option. Now, in the event-handler for the said

menu
item, put the neccesary code for the Save functionality. Build your
application. Now, you can use the Ctrl + S keys to directly save your
document.

"cyshao" wrote:
> How to add a shortcut Ctrl+S ?
>
> I want to add a new function for user to provide Ctrl+S to save things.
> How can I do that?
>
> Thanks
>
> Charles Shao^_^
>
>
>


Nov 17 '05 #4

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

Similar topics

4
27728
by: The Flyer | last post by:
Hi Sorry for posting this message to so many groups, but I was not sure which group the windows keyboard experts would be reading, so I ventured to post it to all of them. I want to map or create shortcut on the keyboard for Cut/Copy/Paste functions. I can use the regular Control_X, C or V to do the same in Windows XP, but I would rather press a single key just like in Sun Solaris keyboards which have specific keys for these functions.
2
2163
by: Nick | last post by:
In VS 2003 and VS 2005 beta 2 I am trying to write a simple program. It has a datagrid and a textbox along with a menubar. There is a command in the menu bar which is "Run Query" and has the shortcut key of Ctrl + R If I am typing in my textbox and hit Ctrl + R an extra r character will show up in the textbox. I decided to then try this in VS 2005 and the same thing happens. If I include the following, Private Sub...
2
29152
by: Jim S | last post by:
I am having a problem finding information regarding vb.net allowing you to create shortcut keys for buttons using the CTRL key + function buttons such as F1, F2 etc.. (Ex: Press CTRL+F1 to activate a click event on a button). If anyone could help it would be sincerely appreciated. Thank You!
10
1980
by: Michael Maes | last post by:
Hi, I want to have a Button.Click event 'raise' a shortcut. If eg Button1 is Clicked, I want to have a shortcut 'CTRL + F12' activated. What's the best way to acchieve this. TIA, Michael
1
2925
by: Emma Middlebrook | last post by:
Hi there, I'm trying to handle some shortcut keys within my application and I can't seem to get the code to work when you are trying to action against a ctrl + other character. I found a post http://groups.google.co.uk/group/microsoft.public.dotnet.languages.csharp/browse_thread/thread/a0bfd442d01f715f/27cbc8062c107680?lnk=gst&q=c%23+shortcut+key+ctrl&rnum=3&hl=en#27cbc8062c107680 that appears to help a lot but it doesn't seem to work...
3
8998
by: ommail | last post by:
I have two RichTextBox controls on a form, and single ContextMenuStrip control which serves for both textboxes. I need to determine which RichTextBox control invokes an event handler in ContextMenuStrip. So I use that code: private void pasteToolStripMenuItem_Click(object sender, EventArgs e)
0
2656
by: thirunavukarasukm | last post by:
Hai... How to Usercontrols with Shortcut Keys... I am creating one windows apllication.. the apllication contain many form.. in one form i am used one usercontrol(parent control)..
2
3018
by: Andrus | last post by:
If focused control is ReadOnly, menu shortcut key is ignored. To reproduce, run code below, press Ctrl+E. Note that message box does not appear. This issue blocks Ctrl+E usage in application. How to fix ? Andrus.
4
1359
by: tshad | last post by:
I need to change a key stroke of CTRL Y to a Redo command (as every other program including Microsofts does) in my VS 2008 program. When I hid CTRL Y now, it deletes the line I am on. As usual, Microsoft doesn't follow standards everyone else does. Is there a way in VS 2008 to do this? Thanks,
0
10162
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
11153
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
11342
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
10689
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...
0
9886
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...
0
7427
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
6113
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...
1
4943
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
4533
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.