How to delete the controls label ,picturebox at runtime ,when Delete key is pressed .
Presently it is not firing the event .
_KeyDown event .. not firing for picturebox,label controls
panel.remove(sender)
Hi, if you want to remove control atruntime, you can try following code
if (e.KeyCode == Keys.Delete)
{
this.Controls.RemoveByKey("ControlName");
}
For more information,please check following thread which talked this topic before.
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=787687&SiteID=1
Best Regards
Gavin