從前,總是使用雙重緩衝,但是這方法不管用,閃爍還是嚴重!自從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