以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  闪烁  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=55385)

--  作者:tujiu
--  发布时间:2014/8/15 15:30:00
--  闪烁
StopRedraw 和ResumeRedraw为了防止表闪烁,有防止控件闪烁的方法吗?我这个是控件叠加的区域,有label,panel,picturebox,textbox等控件。
窗口打开后总会隐隐约约感觉到闪烁。

--  作者:有点甜
--  发布时间:2014/8/15 15:34:00
--  

 用双缓存试试。

 

  e.Form.panel.Gettype().GetProperty("DoubleBuffered",  Reflection.BindingFlags.Instance Or System.Reflection.BindingFlags.NonPublic).SetValue( e.Form.panel,True,Nothing)

 

如果是在对应控件设置的背景,你要对应设置对应控件的双缓存,类似

 

 Dim p As WinForm.PictureBox = e.Form.Controls("PictureBox1")
 p.baseControl.Gettype().GetProperty("DoubleBuffered",  Reflection.BindingFlags.Instance Or System.Reflection.BindingFlags.NonPublic).SetValue(p.baseControl,True,Nothing)