Microsoft KB Archive/822486

= BUG: The sizing grip does not work correctly on a Maximized Windows Form with a StatusBar control =

Article ID: 822486

Article Last Modified on 5/16/2007

-

APPLIES TO


 * Microsoft Visual Basic .NET 2003 Standard Edition
 * Microsoft Visual Basic .NET 2002 Standard Edition
 * Microsoft Visual C# .NET 2003 Standard Edition
 * Microsoft Visual C# .NET 2002 Standard Edition

-





SYMPTOMS
When a Microsoft Windows Form with a status bar control is maximized, there may be a sizing grip on the lower-right corner of the status bar. When you try to move this sizing grip, the status bar does not dock to the bottom of the Windows Form.



WORKAROUND
To work around this bug, disable the sizing grip of the status bar when the Windows Form is maximized. To do this, add the following code in the Form1_Resize event handler.

Microsoft Visual Basic .NET Code If Me.WindowState = FormWindowState.Maximized Then StatusBar1.SizingGrip = False End If Microsoft Visual C# .NET Code if (this.WindowState == FormWindowState.Maximized) statusBar1.SizingGrip = false;



STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed in the &quot;Applies to&quot; section.



Steps to Reproduce the Behavior

 * 1) Start Microsoft Visual Studio .NET (2002) or start Microsoft Visual Studio .NET (2003).
 * 2) On the File menu, point to New, and then click Project.
 * 3) Under Project Types, click Visual Basic Projects or click Visual C# Projects.
 * 4) Under Templates, click Windows Application.
 * 5) Click OK.

By default, Form1 is created.
 * 1) On the View menu, click Toolbox.
 * 2) Add a StatusBar control to Form1.
 * 3) Right-click StatusBar1, and then click Properties.
 * 4) In the Properties window for StatusBar1, set the ShowPanels property to True.
 * 5) Click the ellipsis button (...) for the Panels property to open the StatusBarPanel Collection Editor.
 * 6) Click Add. Under StatusBarPanel1 Properties, set the AutoSize property to Contents, and then click OK.
 * 7) Add a Panel control to Form1.
 * 8) Right-click the panel, and then click Properties.
 * 9) In the Properties window for Panel1, set the Dock property to Bottom.
 * 10) Set the BorderStyle property for Panel1 to FixedSingle.
 * 11) On the File menu, click Save All to save the project.
 * 12) On the Debug menu, click Start to run the application.

Form1 appears on the screen.
 * 1) Maximize Form1.

The resize grip appears at the lower-right corner of the form.
 * 1) Move the sizing grip to the left.

The status bar moves up instead of moving to the left.

