Home All Groups Group Topic Archive Search About

How can I stop IDE touching my code

Author
20 Mar 2006 8:02 AM
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

Author
20 Mar 2006 9:31 AM
MS MVP ³sÀA¶¯ for VB.NET
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


Show quoteHide quote
"Fredrik Melin" <mel@no-spam.dacsa-remove-this.net> wrote in message
news:U7ydnWMSYeUd_IPZRVnygQ@giganews.com...
> 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
>
>
Author
20 Mar 2006 9:43 AM
Cor Ligthert [MVP]
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

Show quoteHide quote
"Fredrik Melin" <mel@no-spam.dacsa-remove-this.net> schreef in bericht
news:U7ydnWMSYeUd_IPZRVnygQ@giganews.com...
> 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
>
Author
20 Mar 2006 9:48 AM
Fredrik Melin
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.


Show quoteHide quote
"Cor Ligthert [MVP]" <notmyfirstn***@planet.nl> wrote in message
news:u1JQ%23JATGHA.2156@tk2msftngp13.phx.gbl...
> 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
>
> "Fredrik Melin" <mel@no-spam.dacsa-remove-this.net> schreef in bericht
> news:U7ydnWMSYeUd_IPZRVnygQ@giganews.com...
>> 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
>>
>
>
Author
20 Mar 2006 10:26 AM
Cor Ligthert [MVP]
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