透明形式闪烁? [英] Transparent form flicker?

查看:99
本文介绍了透明形式闪烁?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hii,有可能避免以透明形式出现絮状.当表单焦点移至另一种形式时,该透明形式闪烁.有什么办法可以使透明形式的絮状细胞出现...

Hii ,is it possible to avoid flcikering for transaparent form.When the form focus goes to another form this transaparent form flickers .is there any way toa void flcikering for transparnet forms...

推荐答案

您是什么意思?您可能有一个简单的代码示例吗?

失去焦点时,可以暂时将窗体可见性设置为false. (或将其设置为完全透明)

您是如何实现的?如果您未按照正确的方式/顺序进行操作,则很可能由于失去焦点而重新绘制会跳过您的代码,因此显示的表单没有透明效果.

在构造函数中尝试以下方法:

How do you mean flickering? Do you maybe have a simple code example?

Possible you could set the form visibility to false temporarily when losing focus. (or set it transparent completely)

How did you implement this? If you didn''t do it in the right way/order it is very well possible that the repaint from losing the focus skips your code and therefore is showing the form without transparency effect.

Try this in the constructor:

InitializeComponent();
this.SetStyle(
            ControlStyles.UserPaint |
            ControlStyles.AllPaintingInWmPaint |
            ControlStyles.DoubleBuffer, true);



另外,看看这个:

带有C#的透明性教程-第3部分 [



Also, have a look at this:

Transparency Tutorial with C# - Part 3[^]


Good luck!


这篇关于透明形式闪烁?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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