Hello everyone,
I am developing a windows application in C#.
On form_keydown event
if (e.KeyCode == Keys.Escape)
{
this.Close();
}
this is working properly
but i want to save data on ctrl+s
i tried for
if (e.KeyCode == Keys.control + Keys.S)
but it throws an error
please help me out.
Regards,
Zuber I. Kazi.
Keys in C#
4 Answers
Know the answer? Post it. Somebody with the same question will find it here.

kishore kumar8 reputationPosted Mar 8, 2012, 8:53 PM EST
//83 Key code for 'S'
If(e.Control && e.KeyValue==83)
{
}
Regards,
Kishore
kishore kumar8 reputationPosted Mar 7, 2012, 2:13 AM EST
//83 Key code for 'S'
If(e.Control && e.KeyCode==83)
{
}
Regards,
Kishore
Sam HobbsRank #107 · 20.5K reputationPosted Mar 7, 2012, 3:44 AM EST
Zuber Kazi38 reputationPosted Mar 8, 2012, 8:43 PM EST
but it again shows an error
"Error 1 Operator '==' cannot be applied to operands of type 'System.Windows.Forms.Keys' and 'int' "