Flicker with Tool Window Child Controls

Docking/MDI for Windows Forms Forum

Posted 18 years ago by Michael Gunlock
When rendering a Tool Window (docking, hiding, activating) there is a brief flicker in the left hand corner of the MDI client area of the form. Please note, I am not talking about flicker within the child control itself...the flicker is occuring in the MDI client area even when, for example, the docking is occuring on the far right client area. It appears the Tool Window's initial rendering occurs at 0,0 coordinates and then at desired coordinates . This type of flicker occurs only when there are child control and when those child windows are not double buffered. Double buffering is not typically a problem, but I have a "flicker free" ListView (by setting LVS_EX_DOUBLEBUFFER flag) with a horizontal scrollbar that exhibits this behavior. Although, the ListView does not flicker, the ListView scrollbar is clearly not double buffered because I now have a brief flash of a horizontal scroll bar (not the ListView) in the left hand corner of the MDI client area for a brief moment before the Tool Window containing the ListView is rendered. If I disable ListView double buffering for the list view, then the entire ListView control and scrollbar briefly flash. How can I avoid this?


Comments (3)

Posted 18 years ago by Michael Gunlock
The message log below is sent to the child control when changing from a floating to docked state. It is clear why there is a flicker.

OnDragging (DocManager Event)
33: WM_WINDOWPOSCHANGING cx = 0 cy = 0 x = 0 y = 0 Parent: toolWindow2
35: WM_SIZE width = 0 height = 0
36: WM_WINDOWPOSCHANGING cx = 143 cy = 370 x = 0 y = 0 Parent: toolWindow2
37: WM_WINDOWPOSCHANGED cx = 143 cy 370
38: WM_SIZE width = 143 height = 370
41: WM_WINDOWPOSCHANGING cx = 143 cy = 345 x = 0 y = 0 Parent: toolWindow2
43: WM_WINDOWPOSCHANGED cx = 143 cy 345
44: WM_SIZE width = 143 height = 345
OnDragged (DocManager Event)

Workaround: Have child ignore these messages. After OnDragged event invalidate dragged Toolwindow and its children.

Problem: To use the workaround, you must be able to reliably detect the start and end of the state change. I have successfully done this for ToolWindow.Activate() as well as during a drag/dock (i.e. messages generated above) because I can determine the start and end of the state change. It has eliminated the flicker...even for controls not double buffered. But I have not be able to determine the state change that is specific to when the "pin button" of an autohide state toolwindow is clicked. This also causes a flicker also like described above. How can I know when the pin button is clicked?...or is there another way?
Posted 18 years ago by Actipro Software Support - Cleveland, OH, USA
It sounds like you need complementry events for AutoHideToolWindowDisplaying and AutoHideToolWindowHiding. That is already on the TODO list but I'll bump up the priority on it.

Actipro Software Support

Posted 18 years ago by Michael Gunlock
The latest build of this product (v24.1.0) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.