I am Designing a windows form in which there is a picturebox which has back arrow image how to assign backspace key as direct shortcut to going back on previous form when current control is on form
1 Answers
Answers 1
Set the form property KeyPreview = true;
. Then use the KeyDown
-Event of the picturebox like this
private void picturebox1_KeyDown(object sender, KeyEventArgs e) { if(e.KeyCode == Keys.Back) this.Close(); }
0 comments:
Post a Comment