表单有背景图片时似乎会闪烁 [英] Form seems to flicker when it has a background Image

查看:183
本文介绍了表单有背景图片时似乎会闪烁的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我有一个带有背景图像的表格.当组件开始加载到表单上时,它似乎闪烁.我曾尝试使用Double缓冲Control.SetStyle(...),但仍然给我带来了问题.有什么想法可以解决吗?

Hi all,

I have a form which has a background image. It seems to flicker when components begin to load on to the form. I have tried using Double buffering, Control.SetStyle(...), still gives me the problem. Any ideas to deal with this?

thanks in advance.

推荐答案

尝试使用SuspendBinding()和ResumeBinding(),它可能会解决您的问题.
try using SuspendBinding() and ResumeBinding(), it may solve your problem.


它是奇怪的检查,您做了一些冲突的绘制事件或正在调整运行时的某些动态控件...

如果您不想显示闪烁
意味着下面的代码将在完成绘制后显示您的表单

将此属性放入您的表单并检查效果
it is strange check you have done some paint event that is conflicting or some dynamic control which you are adjusting runtime...

if you want to not show flicker
means below code will show your form after it complete painting

put this property in your form and check effect
protected override CreateParams CreateParams 
{
    get {
        CreateParams cp = base.CreateParams;
        cp.ExStyle = cp.ExStyle | 0x2000000;
        return cp;
    }
}


祝您编码愉快!
:)


Happy Coding!
:)


这篇关于表单有背景图片时似乎会闪烁的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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