Hi,
I'm currently writing in C# wpf and I would like to imitate the action of clicking a button by the user pressing a key.
private void abuttonispressed(object sender, System.Windows.Input.KeyEventArgs e)
{
if ((Keyboard.Modifiers == ModifierKeys.Control) && (e.Key == Key.S))
{
//click event is raised here
}
}
It's vital that not only the code of that button is run but also the visual 'clicking' of the button. I read about this and suggestions like performclick were made but performclick is not a known method for the button somehow...
Any ideas?