how to delete image from picture box when user press “del” key…I dont find any keypress or keydown events for PB.
private void topRight_pbx_MouseClick(object sender, MouseEventArgs e)
{
imgSelected=true;
//need to accept "delete"key from keyboard?
topRight_pbx.Image = null;
topRFile = "";
}
Change your imgSelected to something like:
On your picturebox click set this variable to the sender:
Then on the keydown of form or the control that has focus you run the image removal code
(Example for form):