G
Guest
This is a curious problem. It seems like it should be quite easy. Of course
a timer is used to determine when form should be closed, but how do you
consistently reset the timer when the mouse is moved over the form.
Normally I would use the MouseMove event to know when the mouse moves over
the form and use that to reset the timer. However, this fails on a form that
has a large number of controls of the form. The Form.MouseMove event will
not fire when the pointer is over a control on the form! Therefore in the
past I built recursive routine to go through the control collections of form
controls and recurse when a container is discovered in the controls
collection. Then for each control found an handler is set for MouseMove to a
method that resets the timer and keeps the form open.
This works but it doesn't seem very graceful. I was wondering if there is
more graceful way to do the same job.
Any help on this is appreciated.
Rob
a timer is used to determine when form should be closed, but how do you
consistently reset the timer when the mouse is moved over the form.
Normally I would use the MouseMove event to know when the mouse moves over
the form and use that to reset the timer. However, this fails on a form that
has a large number of controls of the form. The Form.MouseMove event will
not fire when the pointer is over a control on the form! Therefore in the
past I built recursive routine to go through the control collections of form
controls and recurse when a container is discovered in the controls
collection. Then for each control found an handler is set for MouseMove to a
method that resets the timer and keeps the form open.
This works but it doesn't seem very graceful. I was wondering if there is
more graceful way to do the same job.
Any help on this is appreciated.
Rob