When I scroll horizontally or vertically, the controls collapse with each other until I release the scroll bar and everything draws normally. I already tried with DoubleBuffer and set style after InitializeComponent
SetStyle(ControlStyles.OptimizedDoubleBuffer |
ControlStyles.UserPaint |
ControlStyles.AllPaintingInWmPaint, true);
I also use:
private const int WM_HSCROLL = 0x114;
private const int WM_VSCROLL = 0x115;
protected override void WndProc(ref Message m)
{
if ((m.Msg == WM_HSCROLL || m.Msg == WM_VSCROLL)
&& (((int)m.WParam & 0xFFFF) == 5))
{
// Change SB_THUMBTRACK to SB_THUMBPOSITION
m.WParam = (IntPtr)(((int)m.WParam & ~0xFFFF) | 4);
}
base.WndProc(ref m);
}
But I'm still having the same problem. This is the normal behavior:
And this is when scrolling behavior:
UPDATE i find a solution but it just Reduces sharpness of that flicker solution