解决winform中的panel重绘闪烁问题
2016-02-01 11:50
274 查看
利用winform开发时,可能都会遇到一个问题,就是在panel中不停的重绘图形时,图形会不停的闪烁。要解决这个办法只需要开启双缓冲即可,由于初学c#,理解的不是很深,所以不多做解释。以下代码亲测可以解决这个问题:
首先创建一个自己的panel类:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace Test
{
//开启双缓冲
class MyPanel:Panel
{
public MyPanel()
{
SetStyle(ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer | ControlStyles.ResizeRedraw | ControlStyles.SupportsTransparentBackColor, true);
}
}
}原文地址:http://bbs.delit.cn/thread-677-1-1.html
转载请注明出处:
撰写人:度量科技www.delit.cn
首先创建一个自己的panel类:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace Test
{
//开启双缓冲
class MyPanel:Panel
{
public MyPanel()
{
SetStyle(ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer | ControlStyles.ResizeRedraw | ControlStyles.SupportsTransparentBackColor, true);
}
}
}原文地址:http://bbs.delit.cn/thread-677-1-1.html
转载请注明出处:
撰写人:度量科技www.delit.cn
相关文章推荐
- 运维总监要做什么
- BLE-NRF51822教程6-创建一个自己的服务
- 内存溢出和内存泄露
- NSURLSession简介
- iOSCoreAnimation CAKeyFrameAnimation 详解
- Git入门手册
- 电商网站架构案例
- Spring webapp Junit测试
- IOS CALayer 详解
- 流苏岛之混沌境
- unity3d中脚本生命周期(MonoBehaviour lifecycle)
- XML文件转换成 HTML
- README: 算法竞赛入门
- 解决winform中的panel重绘闪烁问题
- leetcode第一刷_Set Matrix Zeroes
- iOSCoreAnimation CABasicAnimation 详解
- Unity3d中BlinnPhong光照模型注解
- BLE-NRF51822教程5-静态密码设置
- C++开发ActiveX控件相关
- 数据保护API