.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Home >> Forum >> C# >> Post New QuestionBookmark and Share Subscribe to Forum

use of short keys such as ctrl+s in windows apllication

Posted By: Chandranshu Awasthi     Posted Date: June 05, 2011    Points:5   Category :C#

i have a windows apllication project i want to implement short keys in the project...... is anyone help me to do this

thankng you

Author: Gowthammanju             
Posted Date: June 06, 2011     Points: 20   

Just put "&" symbol before the text in text box der by u will find solution

for example

if u put Menu named as file in tool bar just simply add &File in it

Thanks & Regards,

Mark if the answer is true
Author: Sasi Prabhu             
Posted Date: June 06, 2011     Points: 20   

In the Form1_KeyDown event
use like this..

if (e.KeyCode == Keys.F8) // For F8 Key
write the code...

if (ModifierKeys == Keys.Control && e.KeyCode == Keys.s)) // For ctrl + s
write the code...

Thanks & Regards,
Sasi Prabhu.
Author: Chandranshu Awasthi             
Posted Date: June 06, 2011     Points: 20   

thanks to both of you

Author: Ravi Ranjan Kumar             
Posted Date: June 08, 2011     Points: 20   


 protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
if (msg.Msg == 256)
if (keyData == (Keys.Control | Keys.S))
MessageBox.Show("CTRL-S was pressed! ");
return base.ProcessCmdKey(ref msg, keyData);

Take a look at given link for getting reference about creating an event with ctrl+s.

Thanks & Regards
Ravi Ranjan Kumar
Author: Narayanan             
Posted Date: July 12, 2011     Points: 20   

--- Use '&' in the Button Text
--- Use KeyPress Or KeyDown Event in the TextBox
KeyPress :Get ASCII Value
KeyDown : E.Keycode
Lakshmi Narayanan.S

Regards, Lakshmi Naraayanan.S

Post Reply

You must Sign In To post reply
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend