General Category > Tips & Tricks
flickering solution
(1/1)
oqapsking:
hello
i faced an annoying problem with my project
wich is pictures and controls flickering when loading the form
i found two solutions
1- set DoubleBuffered to true in the form properties
2- put this code any where inside your form.vb
--- Code: --- Protected Overrides ReadOnly Property CreateParams() As CreateParams
Get
Dim cp As CreateParams = MyBase.CreateParams
cp.ExStyle = cp.ExStyle Or &H2000000
Return cp
End Get
End Property 'CreateParams
--- End code ---
the second solution worked great for me
and i also kept DoubleBuffered true
i hope this can help others
Archie:
Most of the AdvancedHMI controls use this code in a default constructor to limit flicker and allow transparent background:
--- Code: --- Public Sub New()
MyBase.New
'* reduce the flicker
Me.SetStyle(System.Windows.Forms.ControlStyles.OptimizedDoubleBuffer Or
System.Windows.Forms.ControlStyles.AllPaintingInWmPaint Or
System.Windows.Forms.ControlStyles.UserPaint Or
System.Windows.Forms.ControlStyles.SupportsTransparentBackColor, True)
End Sub
--- End code ---
Phrog30:
Funny, two posts about flickering in the same day. Thanks for posting this Archie.
James
Navigation
[0] Message Index
Go to full version