Muhammad Azam Muhammad Azam - 8 months ago 46
C# Question

Keydown event help using c#

if (e.KeyCode == Keys.S && e.Control)
{
Messagebox.show ("Hello");
}


This is not work!
if i press 'shift' key then it work
why it act like this any problem in this code"help me"

Answer Source

Try using

if (e.KeyData == Keys.S | Keys.Control)
{
    Messagebox.show ("Hello");
}