A question about VS IDE

D

davem

Hello all,

This is a question about something I've run across more than once in Visual
Studio (2005).

For example, yesterday I worked on an application (vb.net) and everything
seemed to be behaving properly.

This morning, after opening up and running the app. I found the code
belonging to the a button click event was not firing. After putting a
breakpoint on the button click event and running the application, the
breakpoint never got hit.

The remedy was to copy the code inside the click event to notepad, delete
the code for the button click event, recreate the sub for the button click
event, and copy the code from notepad into the sub.

The same application had a similar problem with code in the form_load event,
recreate it, and it works.

I make sure to save my work before shutting down. Am I doing something
wrong? This is starting to become a nuisance.

Thanks in advance for any replies.

Dave M.
 
A

Armin Zingler

davem said:
Hello all,

This is a question about something I've run across more than once in
Visual Studio (2005).

For example, yesterday I worked on an application (vb.net) and
everything seemed to be behaving properly.

This morning, after opening up and running the app. I found the code
belonging to the a button click event was not firing. After
putting a breakpoint on the button click event and running the
application, the breakpoint never got hit.

The remedy was to copy the code inside the click event to notepad,
delete the code for the button click event, recreate the sub for
the button click event, and copy the code from notepad into the sub.

The same application had a similar problem with code in the
form_load event, recreate it, and it works.

I make sure to save my work before shutting down. Am I doing
something wrong? This is starting to become a nuisance.

Thanks in advance for any replies.

Dave M.

I can't say it for the form_load event, but for the controls, if you
cut&paste a control, maybe from one container on the Form to another
one, the "Handles" clause is removed after cutting the control. Maybe
this happened in this case. Pasting doesn't put "Handles" in again.


Armin
 
M

Mayur H Chauhan

Davem,
Make sure that all those methods does have handles for the
events raised by that control.

If you are not aware, in case of VB.Net events are handle through the
handle. Name of the method does not have much importance.

Mayur H Chauhan
 
T

Tony K

I had the same thing happen to me last week. I found that any change I made
to the code of a form, after saving and executing, it removed the Handles
Button1.Click for that method. Weirdly, if I kept the code that contains
the "Handles Button1.Click" in view so I could see it, save then execute, it
would not be removed.

Tony K.
 
K

kimiraikkonen

Hello all,

This is a question about something I've run across more than once in Visual
Studio (2005).

For example, yesterday I worked on an application (vb.net) and everything
seemed to be behaving properly.

This morning, after opening up and running the app. I found the code
belonging to the a button click event was not firing. After putting a
breakpoint on the button click event and running the application, the
breakpoint never got hit.

The remedy was to copy the code inside the click event to notepad, delete
the code for the button click event, recreate the sub for the button click
event, and copy the code from notepad into the sub.

The same application had a similar problem with code in the form_load event,
recreate it, and it works.

I make sure to save my work before shutting down. Am I doing something
wrong? This is starting to become a nuisance.

Thanks in advance for any replies.

Dave M.

Dave,
Similar things happen when particular code piece of event wasn't
present such as "Handles" clause. And also make sure, event's
signature matches with the event, however you'll be noticed by IDE if
it doesn't.

Thanks,

Onur
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top