Month:April 2015
Found 2 records. At Page 1 / 1.
-
發布於 2015-04-26 12:54:372015-04-26 12:54:37
Function DoubleBufferedx(ByVal dgv As DataGridView, ByVal setting As Boolean)
Dim dgvType As Type = dgv.GetType()
Dim pi As System.Reflection.PropertyInfo = dgvType.GetProperty("DoubleBuffered", System.Reflection.BindingFlags.Instance Or System.Reflection.BindingFlags.NonPublic)
pi.SetValue(dgv, setting, Nothing)
Return True
End Function
僅此作為筆記。
WeilsNetLogo
This entry was posted in Functions, VB.NET By Weil Jimmer.
-
2015-04-26 12:29:44更新於 2015-04-26 12:43:59
從前,總是使用雙重緩衝,但是這方法不管用,閃爍還是嚴重!自從stackoverflow找到一個很棒的方法後!非常有效!僅此作為筆記。
protected override CreateParams CreateParams {
get {
CreateParams cp = base.CreateParams;
cp.ExStyle |= 0x02000000; // Turn on WS_EX_COMPOSITED
return cp;
}
}
Protected Overrides ReadOnly Property CreateParams() As CreateParams
Get
Dim params As CreateParams = MyBase.CreateParams
params.ExStyle = params.ExStyle Or &H2000000
Return params
End Get
End Property
轉自:http://stackoverflow.com/questions/2612487/how-to-fix-the-flickering-in-user-controls
WeilsNetLogo
This entry was posted in General, Functions, VB.NET By Weil Jimmer.