I have a sample C# Application which have 4 buttons like this:
I want when I press a UP button respective the others to be pressed the correspondent button from C# Application (when window is focused) and keeps being pressed simultaneously with keyboard. How to do this? I've tried with KeyEventArgs and KeyPress but I think I'm a little bit confused.
LE: And to have somewhat possibility to press 2 buttons simultaneously:
======================================================
Edit Later: I can't really understand. I've created a new project. The whole code is:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace test3
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
this.KeyDown += Form1_KeyDown;
}
private void Form1_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Up) { MessageBox.Show("|"); }
}
}
}
This is the whole code of new project, Why isn't showing te message box when press Up button from keybard? It is working for letters...