Some odd behaviour in User Controls with Timers

Still working on the client's project. My prog. pair and I noticed something interesting when using a timer with a usercontrol.

We are using the timer to fire off a poling process to check status posted to a DB table. The status is a time stamp indicating completion of a remote running process (which may or may not be running on the machine hosting the DB). We are using the Enter and Leave events for the UserControl to start and stop the poling. When we enter the control (as a part of showing it), we enable the timer. When we leave, we stop it. Seems like no problem, right?

It isn't a problem when running, but if we place a breakpoint in the Leave event, a strange thing happens. We get the Leave event firing, but then the thread just suspends and sits there like it is expecting something else to happen. Since it doesn't really hurt anything (so long as we don't interrupt the thread), we didn't really dig into it deeply. Just sort of an interesting quirk worthy of note.

posted @ Wednesday, June 27, 2007 12:25 AM

Print
Comments have been closed on this topic.
«December»
SunMonTueWedThuFriSat
30123456
78910111213
14151617181920
21222324252627
28293031123
45678910