How can I stop IDE touching my code

  • Thread starter Thread starter Fredrik Melin
  • Start date Start date
F

Fredrik Melin

If you open a form, add a button, double click on the button, you now enter
the code for the button click event.

If you switch back to the form, and remove the button, it will also remove
the "Handles Button1.click" code, function will remain but the handles tag
will be removed, is there a way to stop the IDE doing this all together?

(I want an error saying Button1 is not found)

Ive tried most of the settings I could find, but no luck.

- Fredrik
 
Dear Fredrik Melin,

I am afraid that you cannot. As this is one of the feature that VS.NET
Provide.



--
Hope this help and welcome to reply the testing result.

Regards
Ken Lin, Kam Hung
Founder and VP of Hong Kong .NET User Group(http://HKNetUG.com)
MCP, MCP+I, MCDST, MCSA, MCSE(NT4 & win2k),
MCSE+I, MCDBA(SQL7 & SQL2K), MCSD(VB6 & .NET), MCAD(.NET)
Microsoft Community Star(Hong Kong & Taiwan)
Microsoft Most Valuable Professional(.NET since 2003)
MCT2004 & 2005
 
Fredrik,

I am glad it functions like that.

If not, than I had everytime to save my code if I was playing with the
designer.

By instance changing a button for an image button.

Now you only have to add the handler.

Before somebody starts to change this behaviour.
You are free to disagree with me.

Cor
 
Yep, 99% of the time I want it too, for this particular thing I am doing
(moving out controls to a uc in a separate project) I really would like to
get tons of errors so I dont miss anything..
Else its sooo easy to miss a validate event which is common for several
controls.
 
Frederik,

If you want to do this, than an easy way is to copy your form and change the
class name in the new one, or "Cut" your by the designer created code, paste
it back direct again (if you copy it than the handlers are not taken), and
than paste it as well in your new form.

(By the last operations I save my base form from which I cut as well first
by the way as a copy).

Cor
 
Back
Top