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


Top 5 Contributors of the Month
david stephan

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#
hi

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

thankng you

Responses
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,
GowthamManju
Chennai



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   

Try

 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.
http://social.msdn.microsoft.com/Forums/en/csharplanguage/thread/40391095-430b-4218-a4c7-b162e0e5b347


Thanks & Regards
Ravi Ranjan Kumar
http://raviranjankr.wordpress.com
Author: Narayanan             
Posted Date: July 12, 2011     Points: 20   

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

Regards, Lakshmi Naraayanan.S
http://dotnettechrocks.blogspot.in/


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
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

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