Can you post the error please?
Hi,
I have taken 2 boolean variables, in the key down events of # and 5, it will be set to true and if both of them are true then the information will be shown in the textboxes.
Now the problem is whenever I press # or 5, the information is shown in the textboxes.
I am using I-mate, in that to get access to # and 5 we have to press the shift key, when I press shift key then keydown event of shift is fired.
Should I take another variable to store the shift keydown event?
the code is given below:
public bool kp, kp1;
private void Form1_KeyDown(object sender, KeyEventArgs e)
{
if ((e.KeyCode == System.Windows.Forms.Keys.D5))
{
kp = true; //5
}
else
{
kp = false;
}
if ((e.KeyCode == System.Windows.Forms.Keys.F9))
{
kp1 = true; //#
}
else
{
if (kp1!=true )
{
kp1 = false;
}
}
if (kp1 == true)
{
if (kp == true)
{
label1.Text = "# & 5 keys are pressed";
}
}
}
please let me know what mistake I am making