I'm making a winform application. I'm trying to add a keydown event to a combo box so I prepared the event implementation and then I added inside the form.designers document the line:
this.cmboxSearchPath.KeyDown += cmboxSearchPath_KeyDown;
for some reason this line always get deleted from the document.. do you know why and how can I stop it from being deleted?
for some reason this line always get deleted from the document.. do you know why and how can I stop it from being deleted?
Don't put it in the designer generated code. You can include this in your constructor after the InitializeComponent()
call, or allow the designer to generate this for you by wiring up the event via the designer itself.