Windows Forms stops responding after debugging

B

Ben R. Bolton

I am experiencing a very odd problem. When I stop my application at a break
point or with an Assert, after I continue running my form stops responding.
Is this a known problem or does any one have any suggustions as to what may
be happing or how to "debug" it.

Background:
We have developed a client application that is built on multiple layers of
UserControls. There are dozens of usercontrols made up of standard window
Forms controls and a few inherited windows Forms controls.

When ever I stop the application at a break point or with an Assert
everything behaves as expected. I can step through the code, look at
fields/properties etc. But when I continue the application, the webForm
displays, can be minimized, maximized, but cannot be closed. Individual
controls "react" to mouse movement, (for example a Treeview with hot
tracking will "track" mouse over a treenode) but I cannot select a node in
the tree view or List View. Menu don't open (main or context), buttons
don't respond to being clicked.

I will continue to try an isolate what "recent" changed were made to
determine what could be causing this, since it didn't behave like this
before, but I was hopeing this behavior has been seen before and there is a
know course of action to resolve it or at least identify what could be
causing it.

Any assistance would be apreciated.

Ben R. Bolton
 
B

Ben R. Bolton

I don't know how common this would be, but I found the problem.

I had created an seperate Arraylist of some key controls. When I rebuilt
one of our UserControls I cleared all the sub controls on a panel using
xxPanel.Controls.Clear() and re-created them adding the new copies back into
the Controls collection of xxPanel. But I didn't clear the controls from my
seperate key controls list. This really confused WinForms since there were
events "firing" but those controls were not on any form. The solution to my
problem was to remove the references to cleared controls from my ArrayList.
Once all references were removed the WinForms application appeared to be
behaving normally.

Ben.
 

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