以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  切换页面时发生闪烁  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=77492)

--  作者:kaituozhe
--  发布时间:2015/11/19 11:14:00
--  切换页面时发生闪烁

发生闪烁的原因是引用了以下图片,怎么既不闪烁又能使用图片

Dim tbl As WinForm.TabControl = e.Form.Controls("TabControl1")
tbl.TabPages(0).BackgroundImage = GetImage("g:\\会计服务\\预算管理\\attachments\\图片1.jpg")
tbl.TabPages(0).BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch


--  作者:大红袍
--  发布时间:2015/11/19 11:43:00
--  

双缓存试试

 

Dim tbl As WinForm.TabControl = e.Form.Controls("TabControl1")

Dim btbl = tbl.basecontrol
Dim p = btbl.tabpages(0)
p.Gettype().GetProperty("DoubleBuffered",  Reflection.BindingFlags.Instance Or System.Reflection.BindingFlags.NonPublic).SetValue(p,True,Nothing)

tbl.TabPages(0).BackgroundImage = GetImage("d:\\test.jpg")
tbl.TabPages(0).BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch

 

不行,上传例子