Integrated Application Platform › Forums › General › Display issues with adding/removing from VertConrol › Re: Re: Display issues with adding/removing from VertConrol
I agree the flickering is annoying. I guess I have just got used to it!
I think this is coming from the .WindowRefresh() in Group (parent of Vert and Horz) Insert and Remove
Because of stretchable controls and fill, adding or removing (or resizing) a control can cause non-local changes, so the layout for the entire window has to be recalculated. Of course, most of the time only certain parts of the window actually change.
WindowBase.Refresh does combine multiple refreshes to reduce the flickering.
The refresh ends up calling Resize on each control which usually ends up in Hwnd.Resize that calls SetWindowPos. But it still flickers even if I change this to not call SetWindowPos if the size is the same.
Now that I look at it, I’m not sure where the flickering is actually coming from.
If you are using FieldControl is has a .Repaint() in .SetBgndColor which is probably unnecessary when called by New. But commenting it out doesn’t help.
The SWP.NOCOPYBITS in Hwnd.Resize is suspicious, but again commenting it out doesn’t help.
The CS.REDRAW in the Window class definitions in Init also caught my eye, but removing it didn’t help.
It seems like something is erasing and redrawing the whole window, but I can’t find where that would be coming from.
Sorry, I am stumped. I wrote most of this code, but it was a long time ago!
Anyone else have any ideas?