How to delete dynamically created Textbox using delete key on keyboard?

  • Thread starter Thread starter jbwrks
  • Start date Start date
J

jbwrks

Guest
I created dynamic textbox(es), picturebox(es) and whenever calling delete key to delete the picturebox or textbox, the delete effect is not happening. In fact, I have a Textbox and a small picture box on my form, along with a big picture box. I drag and drop text box and small picture box on to the big picture box. The boxes get created dynamically using 'new'. If I don't have the text box dragged and dropped, it is easy to delete the small picture box; but, i have to set textbox on the form to Enabled = false;. Otherwise, it doesn't delete or remove. Similarly, if I have dragged and dropped a textbox on to the big picture box, i am unable to even set Enable to 'false' ( though trying to set the same in the code doesn't have any effect on the drag dropped textbox). I have Googled for solution but found that all the examples used either a button or checkbox, through which, the deletion or removal of textbox could be effected. But I want to use delete key only and ensure the drag dropped dynamic textbox is deleted. How?

Thanks in advance.

Continue reading...
 
Back
Top