zoukankan
html css js c++ java
无闪烁的listview
Q:http://topic.csdn.net/u/20071205/15/116fa433-69bc-418d-a31c-3c279abc8007.html
A:
public
partial
class
Form1 : Form
...
{
class
DoubleBufferListView : ListView
...
{
public
DoubleBufferListView()
...
{
SetStyle(ControlStyles.DoubleBuffer
|
ControlStyles.OptimizedDoubleBuffer
|
ControlStyles.AllPaintingInWmPaint,
true
);
UpdateStyles();
}
}
public
Form1()
...
{
InitializeComponent();
}
DoubleBufferListView lv
=
new
DoubleBufferListView();
private
void
Form1_Load(
object
sender, EventArgs e)
...
{
this
.Controls.Add(lv);
lv.Height
=
300
;
lv.Width
=
300
;
new
System.Threading.Thread(
new
System.Threading.ParameterizedThreadStart(doAdd)).Start();
}
void
doAdd(
object
obj)
...
{
if
(
this
.InvokeRequired)
...
{
this
.Invoke(
new
System.Action
<
object
>
(doAdd),
new
object
[]
...
{ obj }
);
}
else
...
{
for
(
int
i
=
0
; i
<
100
; i
++
)
...
{
this
.lv.Items.Add(
new
ListViewItem(
"
jinjazz
"
+
this
.lv.Items.Count.ToString()));
System.Threading.Thread.Sleep(
10
);
Application.DoEvents();
}
}
}
}
查看全文
相关阅读:
spring快速入门
Vue整合ElementUI搭建项目
.Net的Rsa解密
Maven配置国内仓库
pom.xml
SpringBoot文件打包后修改配文件
.net 过滤器
c#语法糖汇总
git修改远程地址
abp Application层,接口服务层,获取请求的信息
原文地址:https://www.cnblogs.com/cl1024cl/p/6204980.html
最新文章
C#程序運行于Xp系統
C#如何调用C++的dll(代码示范如何转换char*、unsigned long、unsigned long*、enum参数)
C++使用纯虚函数和单例模式导出接口的动态库的写法
C++与 Fluke5500A设备通过GPIB-USB-B通信的经验积累
Thymeleaf从入门到精通
对集合中元素的删除为什么要使用迭代器
Apache ShardingSphere --->2.数据分片的核心概念
Apache ShardingSphere --->1.基本概念
第15章:Linux实操篇 RPM 与 YUM
第14章:Linux实操篇 进程管理
热门文章
第13章:Linux实操篇 网络配置
第12章:Linux实操篇 Linux磁盘分区、挂载
第11章:Linux实操篇 定时任务调度
MySQL:实现累加求和的功能
【转】GERBER文件逆向生成Altium Designer PCB
[转]RS485光耦+DCDC隔离
【转】给电路初学者的 LTspice操作入门教程 Step by Step
【原】quartus prime18.1自制IP核修改后如何在qsys中更新
c#连接字符串和DbUtils
Spring基础之加载外部文件
Copyright © 2011-2022 走看看