System.Windows.Forms sizing grip problem

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Andrei Zinca

    #1

    System.Windows.Forms sizing grip problem

    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;
    }


  • Pronojit Roy

    #2
    Re: System.Windows. Forms sizing grip problem

    Hello Andrei Zinca

    can u give me ur code in detail

    bye
    pronojit

    "Andrei Zinca" <zink82@xnet.ro > wrote in message
    news:OTrg5I8gDH A.452@TK2MSFTNG P12.phx.gbl...[color=blue]
    > 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[/color]
    dispose[color=blue]
    > 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;
    > }
    >
    >[/color]


    Comment

    Working...