I have the below code where I am expecting that when the user will press the CTRL +R , the program will be trigger
public Form1()
{
InitializeComponent();
button1.KeyPress +=new KeyPressEventHandler(button1_KeyPress);
}
private void button1_KeyPress(object sender, KeyPressEventArgs e)
{
if ((e.KeyChar == (char)Keys.ControlKey) && (e.KeyChar == (char)Keys.R))
{
MessageBox.Show("hello");
}
}
But it is not working. Also the code is expected to run invariable of 'r' or 'R' is pressed.
Please help where I am making mistake.
Thanks.