表格在加载时闪烁 [英] Form Flickering on Load
本文介绍了表格在加载时闪烁的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我怎样才能避免形式闪烁?
我试过 SuspendLayout()
和 ResumeLayout()
。但它没有帮助
How can i avoid form flickering ?
I tried SuspendLayout()
and ResumeLayout()
.But it didn't help
推荐答案
尝试设置 DoubleBuffered
尝试使用此代码来防止表单和控制闪烁
Try this code to Prevent Form and control flickering
Protected Overloads Overrides ReadOnly Property CreateParams() As CreateParams
Get
Dim cp As CreateParams = MyBase.CreateParams
cp.ExStyle = cp.ExStyle Or 33554432
Return cp
End Get
End Property
你也可以尝试这个功能
you Can Try this Function too
Private Sub PreVentFlicker()
With Me
.SetStyle(ControlStyles.OptimizedDoubleBuffer, True)
.SetStyle(ControlStyles.UserPaint, True)
.SetStyle(ControlStyles.AllPaintingInWmPaint, True)
.UpdateStyles()
End With
End Sub
在表格中调用此事件加载事件
Call this in forms Load Event
这篇关于表格在加载时闪烁的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文