Toolbar Flicker

Started by Robert Eaton, January 03, 2010, 05:01:30 PM

Previous topic - Next topic

Robert Eaton

Is there a way to improve the toolbar flicker when a form is resized?


Paul Squires

Are you sure it is toolbar flicker and not statusbar flicker? I don't see toolbar flicker, but statusbars do flicker because panel sizes in the statusbar are recalculated and displayed during resize.

Are you displaying other things in your WM_SIZE handler and not taking into account the height of the toolbar and any statusbars on the form?

Paul Squires
PlanetSquires Software

Robert Eaton

Paul,
Here is a sample project that displays the flicker. It only has a toolbar with some icons attached to the buttons.
No code in the project at all.



Paul Squires

Hi Robert,

Okay, I see the flicker. It did not show very well on my Windows 7 but under the WinXP mode it does flicker. The reason is that FireFly outputs code in the FORM1_FORMPROCEDURE to automatically resize toolbars and statusbars when the form size changes. Here is the code directly from your sample project:


    ' Handle the sizing of any toolbars/statusbars
    If wMsg = %WM_SIZE Then                     
        ' Resize the toolbar if one is present
        If wParam <> %SIZE_MINIMIZED Then
           If IsWindow( GetDlgItem(hWndForm, IDC_FORM1_TOOLBAR1) ) Then
              SendMessage GetDlgItem(hWndForm, IDC_FORM1_TOOLBAR1), wMsg, wParam, lParam
           End If
        End If
    End If       


Without the above code, the toolbar will not extend to the right edge of the form whenever the form size changes. Maybe that is goo, maybe it is not. In my eyes, I would prefer to have the toolbar extend to the right edge.
Paul Squires
PlanetSquires Software

Robert Eaton

Okay, that makes sense.

Thanks,
Bob

Thomas Cone Jr


Paul Squires

:)   Should have been "good".
Paul Squires
PlanetSquires Software

Cho Sing Kum

The toolbar will not flicker if you use a Rebar control for the Toolbar.

However, the Rebar height is too short and there is no option to change the height. The images, or texts if there are, are too near the bottom boundary.

Roger Garstang

There is also a Class Style for Redraw Vert/Horz that can help flicker too.  And, various combinations of Clip styles, etc.  Really helpful if Windows is setup to display window when sizing/dragging instead of the outline.