PRB: Double-Clicking Control Box Causes MouseUp Event in VB (79599)
The information in this article applies to:
- Microsoft Visual Basic Standard Edition for Windows 2.0
- Microsoft Visual Basic Standard Edition for Windows 3.0
- Microsoft Visual Basic Professional Edition for Windows 2.0
- Microsoft Visual Basic Professional Edition for Windows 3.0
- Microsoft Visual Basic Standard Edition for Windows 1.0
This article was previously published under Q79599 SYMPTOMS
Double-clicking the control box of a form to close it causes a
MouseUp event on an enabled form or control if it is lying beneath the
control box.
RESOLUTION
You can prevent the above behavior in several ways:
- Set a global flag in the MouseDown event and check the flag in the
MouseUp event. If the flag is set, perform the event and set
the flag to FALSE. If the flag is not set, exit the MouseUp event.
- Set a global flag in the overlapping form's Form_Unload event, and
then test this flag in the underlying form or control's MouseUp
event.
- Restrict the placement or movement of a form so that it's control
box does not appear above an enabled form or control.
- Avoid coding the MouseUp event of any enabled form or control over
which a control box may appear.
STATUS
This behavior is by design. It is standard behavior inherent to Windows,
and is not an error in Visual Basic.
Modification Type: | Major | Last Reviewed: | 12/12/2003 |
---|
Keywords: | kbprb KB79599 |
---|
|