Click here to Skip to main content
15,510,087 members

Comments by Member 15627303 (Top 2 by date)

Member 15627303 11-May-22 14:15pm View    
if use KeyDown event to be inactive when release, then my code need to use with KeyUP event. correct me if I am wrong.
Member 15627303 6-May-22 20:37pm View    
you mean like this:

private void MainWindow_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.NumPad0)
{
funcDisp.Text = "Pwr.Wheel";
funcDisp.ForeColor = Color.LimeGreen;
set1Disp.Text = "Up";
set1Disp.ForeColor = Color.LimeGreen;
set2Disp.Text = "Down";
set2Disp.ForeColor = Color.LimeGreen;

switch (e.KeyCode)
{
case Keys.NumPad1:
{
textVolt.Text = "UP";
break;
}

case Keys.NumPad2:
{
textBrake.Text = "DOWN";
break;
}
}
}