没找到好办法,把所有控件都加上双缓存了。有一些代码是不必要的,你根据效果删除对应的控件的双缓存即可。
Dim p1 As WinForm.Panel = e.Form.Controls("Panel1")
p1.baseControl.Gettype().GetProperty("DoubleBuffered", Reflection.BindingFlags.Instance Or System.Reflection.BindingFlags.NonPublic).SetValue(p1.baseControl,True,Nothing)
Dim p2 As WinForm.SplitContainer = e.Form.Controls("SplitContainer1")
Dim p3 As object= p2.Panel1
Dim p4 As object = p2.Panel2
p2.baseControl.Gettype().GetProperty("DoubleBuffered", Reflection.BindingFlags.Instance Or System.Reflection.BindingFlags.NonPublic).SetValue(p2.baseControl,True,Nothing)
p3.baseControl.Gettype().GetProperty("DoubleBuffered", Reflection.BindingFlags.Instance Or System.Reflection.BindingFlags.NonPublic).SetValue(p3.baseControl,True,Nothing)
p4.baseControl.Gettype().GetProperty("DoubleBuffered", Reflection.BindingFlags.Instance Or System.Reflection.BindingFlags.NonPublic).SetValue(p4.baseControl,True,Nothing)
Dim p5 As WinForm.PictureBox = e.Form.Controls("PictureBox1")
p5.baseControl.Gettype().GetProperty("DoubleBuffered", Reflection.BindingFlags.Instance Or System.Reflection.BindingFlags.NonPublic).SetValue(p5.baseControl,True,Nothing)
Dim p6 As WinForm.TabControl = e.Form.Controls("TabControl1")
p6.baseControl.Gettype().GetProperty("DoubleBuffered", Reflection.BindingFlags.Instance Or System.Reflection.BindingFlags.NonPublic).SetValue(p6.baseControl,True,Nothing)
Dim p7 As object = p6.basecontrol
p7.tabpages(0).Gettype().GetProperty("DoubleBuffered", Reflection.BindingFlags.Instance Or System.Reflection.BindingFlags.NonPublic).SetValue(p7.tabpages(0),True,Nothing)