闪存面板通过创建运行时标签winform C# [英] flickering panel by create runtime labels winform C#

查看:57
本文介绍了闪存面板通过创建运行时标签winform C#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

详细信息



我有一个窗口表单,其中包含该图表上的图片框和加载图片。之后我将panel1拖放到该图片框上并加载图片运行时文件单击按钮,然后下一个图像将加载..但我在该面板上创建标签运行时至少30个标签...如果我的项目加载它执行闪烁的数据面板。如果我点击按钮加载另一个图像它将再次闪烁该标签。 br />


我已经搜索了很多找到的解决方案但它不起作用



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



this.DoubleBuffered = true;



i放置dat代码进入我的表单构造函数。但它没有工作..它不会阻止我的闪烁。





。我想阻止这个闪烁。有人帮我阻止这种闪烁。



先谢谢你帮助我

Details

I have one Window form which contain picturebox and load image on that form.after that i drag and drop panel1 on that picturebox and load images runtime wen click button then next image will load..but i create label runtime on that panel atleast 30label...wen my project load it perform flickering on dat panel.if i click button to load another image it will again flicker on that label.

I already search alots found solution but it does not work

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

this.DoubleBuffered = true;

i placed dat code into my form constructor .but it didnot work..it does not stop my flickering.


.i want to stop this flickering .anyone help me to stop this flickering.

Thanks in advance to help me

推荐答案

检查你做了一些冲突或添加动态控制的绘制事件,你正在调整load事件或构造函数中的运行时...



如果你不想显示闪烁

意味着下面代码会在完成绘画后显示你的表格



将此属性放入您的表单并检查效果

check you have done some paint event that is conflicting or adding some dynamic control and which you are adjusting runtime on load event or in constructor...

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!
:)


这篇关于闪存面板通过创建运行时标签winform C#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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