gui屏幕在C#中闪烁 [英] gui screens flicker in c#

查看:113
本文介绍了gui屏幕在C#中闪烁的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

[ ^ ]
我已经在本文中使用了技巧,它可以在Windows 7上使用,但是在Windows XP中,一旦表格完成绘制背景,屏幕背景就会消失.

有谁知道如何解决它.
覆盖createparams时出现的问题会在很大程度上减少您的闪烁.如果您仍然不满意,可以启用DoubleBuffering.表单立刻使它变得更难呈现,

当我加载表格时,我将不透明度设置为0;我启用了一个计时器,在计时器刻度上
当不透明度== 1时,不透明度+ = 0.05会禁用计时器.


[^]
i have used the tip in this article it works on the windows 7 but with windows xp the screen background shows once the form finish painting the background disappear.

does anyone know how to solve it.
the problem when overriding the createparams

解决方案

As a general suggestion, enclose your painting/updating logic inside a Control.BeginUpdate() and Control.EndUpdate() block, it would reduce your flickering to a great extent. If you are still not satisfied, you can enable DoubleBuffering.


I used simple trick is to use timer to show the form hidden after some timer i increase the visibilty to fully show the form, showing the form at once make it harder to be rendered,

when i Load the form i set the Opacity = 0; and i enabled a timer, on timer tick
Opacity += 0.05 when the opacity ==1 i disable the timer.


这篇关于gui屏幕在C#中闪烁的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆