Reputation: 1317
I have created an image button which does something if double-clicked. I want pressing enter also to do the same thing. How can I do that?
Upvotes: 0
Views: 490
Reputation: 493
You could use the KeyDown
event check if e.Key == Keys.Enter
then call the same function that the double click uses.
Upvotes: 0
Reputation: 16118
If it's a WPF button then do IsDefault="True"
and install a regular click handler.
Upvotes: 1