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



The information in this article applies to:

  • Microsoft Visual Basic .NET (2003)
  • Microsoft Visual Basic .NET (2002)
  • Microsoft Visual C# .NET (2003)
  • Microsoft Visual C# .NET (2002)

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 "Applies to" section.

MORE INFORMATION

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.
  6. On the View menu, click Toolbox.
  7. Add a StatusBar control to Form1.
  8. Right-click StatusBar1, and then click Properties.
  9. In the Properties window for StatusBar1, set the ShowPanels property to True.
  10. Click the ellipsis button (...) for the Panels property to open the StatusBarPanel Collection Editor.
  11. Click Add. Under StatusBarPanel1 Properties, set the AutoSize property to Contents, and then click OK.
  12. Add a Panel control to Form1.
  13. Right-click the panel, and then click Properties.
  14. In the Properties window for Panel1, set the Dock property to Bottom.
  15. Set the BorderStyle property for Panel1 to FixedSingle.
  16. On the File menu, click Save All to save the project.
  17. On the Debug menu, click Start to run the application.

    Form1 appears on the screen.
  18. Maximize Form1.

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

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

REFERENCES

For more information about the StatusBar control, visit the following Microsoft Developer Network (MSDN) Web site:

Modification Type:MinorLast Reviewed:2/3/2006
Keywords:kbvs2005doesnotapply kbvs2005swept kbvs2002sp1sweep kbCodeSnippet kbWindowsForms kbStatBar kbControl kbbug KB822486 kbAudDeveloper