FIX: Double-Click Still Maximizes/Restores If MaxButton=False (110309)
The information in this article applies to:
- Microsoft Visual Basic Standard Edition for Windows 2.0
- Microsoft Visual Basic Professional Edition for Windows 2.0
This article was previously published under Q110309 SYMPTOMS
Setting the MaxButton property of a form to False removes the Maximize item
in the Control-menu box and removes the maximize button in the upper right
corner of the form. However, double-clicking the title-bar still maximizes
the form or toggles back to the default size.
The Control-menu box is also known as the System-menu box in other products
for Windows.
CAUSE
By default, double-clicking the title bar has the same effect as choosing
Maximize or Restore from the Control-menu box -- it acts as a toggle
between the normal window size and the maximized window size. This behavior
is by design in standard Microsoft Windows. Setting the MaxButton property
of the form to False fails to suppress this behavior in Visual Basic
version 2.0.
WORKAROUND
To prevent a double-click on the title bar from causing Maximize or
Restore, call Windows API functions as shown in the sample program
in the More Information section below.
STATUS
Microsoft has confirmed this to be a problem in Visual Basic version 2.0
for Windows. This problem was corrected in version 3.0. In version 3.0,
setting the form's MaxButton property to False correctly ignores double-
clicks on the title bar.
REFERENCES
"PC Magazine's Visual Basic Programmer's Guide to the Windows API" by
Daniel Appleman (of Desaware), published by Ziff-Davis Press, pages 414
and 418. This reference describes most Windows API functions that can
be used from within Visual Basic.
Modification Type: | Major | Last Reviewed: | 10/29/2003 |
---|
Keywords: | kbbug kbfix KB110309 |
---|
|