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();
}
}
}
}
查看全文
相关阅读:
学习Linux shell脚本中连接字符串的方法
使用 ffmpeg 转换视频格式
一点不懂到小白的linux系统运维经历分享
linux利用scp远程上传下载文件/文件夹
angular ui-select
JavaScript sort()方法
js性能优化
layer弹出层
JS复制对象
某天修改了啥bat批处理
原文地址:https://www.cnblogs.com/cl1024cl/p/6204980.html
最新文章
Java缓存学习之六:Spring单独使用EhCache
Java缓存学习之五:spring 对缓存的支持
【Java语言特性学习之一】设计模式
MYSQL数据库重点:事务与锁机制
MYSQL数据库重点:自定义函数、存储过程、触发器、事件、视图
MQ详解及四大MQ比较
Testner自动化测试平台免费开放啦
“Testner测试圈”-长沙软件测试自动化沙龙即将举办
mysql只能通过localhost而不能使用本机ip访问的问题
Pycharm生成可执行文件.exe
热门文章
python调用企业微信接口发送群聊消息代码参考
python模拟http请求
python协程系列
python之ssh连接
python调用企业微信接口发送报警信息
如何在Linux环境下通过uwgsi部署Python服务
网络组建中的相关步骤及其问题排错
写给正在入坑linux系统的伙伴
理解三次握手和四次挥手
在Linux 中如何从进程相关的文件描述中恢复数据
Copyright © 2011-2022 走看看