I have a custom control with line shapes on it. This control is in my panel. Whenever I scroll horizontally on the panel, my control's lines flicker very badly. I've been trying to find a solution to this and have looked at many forums and questions by others, but still haven't seen an answer that works for me.
Asked
Active
Viewed 711 times
1 Answers
1
I assume this is winforms as you do not have a wpf tag. If so - try this - it may help. This helped with a flickering problem I had.
You can read about it here: http://www.vbmigration.com/detknowledgebase.aspx?Id=692
Protected Overrides ReadOnly Property CreateParams() As CreateParams
'this is magic code that has an enormous positive effect on reducing flickering.
'don't remove this.
'found this nugget here: http://www.vbmigration.com/detknowledgebase.aspx?Id=692
Get
Dim params As CreateParams = MyBase.CreateParams
params.ExStyle = params.ExStyle Or &H2000000
Return params
End Get
End Property

M. Ferry
- 147
- 5
-
Appreciate the reply! It definitely helped - I would say the flicker reduced by 85%. – Zach Fry Apr 13 '17 at 01:17
-
Far out, do you know how old that article is... its 15 years old. A better way is to use DoubleBuffering. – Jeremy Thompson Apr 13 '17 at 01:23
-