Microsoft KB Archive/79599

= PRB: Double-Clicking Control Box Causes MouseUp Event in VB =

Article ID: 79599

Article Last Modified on 12/12/2003

-

APPLIES TO


 * Microsoft Visual Basic 2.0 Standard Edition
 * Microsoft Visual Basic 3.0 Professional Edition
 * Microsoft Visual Basic 2.0 Professional Edition
 * Microsoft Visual Basic 3.0 Professional Edition
 * Microsoft Visual Basic 1.0 Standard Edition

-



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.

Additional query words: 2.00 3.00

Keywords: kbprb KB79599

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.