When I resize my window, the sizing grip from the status bar doesn't
dissapear. The funny thing is that if i create a graphics object and dispose
it before the creation of the status bar everything works fine.
Maybe someone can help me with this problem. Thanks!
Here's my StatusBar initialization routine
void InitStatusBar()
{
Graphics g = CreateGraphics( ); // If i do this
g.Dispose(); // it works
sb = new StatusBar();
sb.Parent = this;
sb.ShowPanels = true;
// Help panel
sb.Panels.Add(" Help");
sb.Panels[0].AutoSize = StatusBarPanelA utoSize.Spring;
sb.Panels[0].Alignment = HorizontalAlign ment.Left;
// Date panel
sb.Panels.Add(D ateTime.Now.ToS hortDateString( ));
sb.Panels[1].AutoSize = StatusBarPanelA utoSize.Content s;
sb.Panels[1].Alignment = HorizontalAlign ment.Center;
// Time panel
sb.Panels.Add(D ateTime.Now.ToS hortTimeString( ));
sb.Panels[2].AutoSize = StatusBarPanelA utoSize.Content s;
sb.Panels[2].Alignment = HorizontalAlign ment.Center;
}
dissapear. The funny thing is that if i create a graphics object and dispose
it before the creation of the status bar everything works fine.
Maybe someone can help me with this problem. Thanks!
Here's my StatusBar initialization routine
void InitStatusBar()
{
Graphics g = CreateGraphics( ); // If i do this
g.Dispose(); // it works
sb = new StatusBar();
sb.Parent = this;
sb.ShowPanels = true;
// Help panel
sb.Panels.Add(" Help");
sb.Panels[0].AutoSize = StatusBarPanelA utoSize.Spring;
sb.Panels[0].Alignment = HorizontalAlign ment.Left;
// Date panel
sb.Panels.Add(D ateTime.Now.ToS hortDateString( ));
sb.Panels[1].AutoSize = StatusBarPanelA utoSize.Content s;
sb.Panels[1].Alignment = HorizontalAlign ment.Center;
// Time panel
sb.Panels.Add(D ateTime.Now.ToS hortTimeString( ));
sb.Panels[2].AutoSize = StatusBarPanelA utoSize.Content s;
sb.Panels[2].Alignment = HorizontalAlign ment.Center;
}
Comment