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

ID: Q79599


The information in this article applies to:
  • Microsoft Visual Basic Standard and Professional Editions for Windows, versions 2.0, 3.0
  • Microsoft Visual Basic programming system for Windows, version 1.0


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 :
Version : WINDOWS:1.0,2.0,3.0
Platform : WINDOWS
Issue type :


Last Reviewed: January 25, 2000
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.