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();
}
}
}
}
查看全文
相关阅读:
CSS Transform让百分比宽高布局元素水平垂直居中
Apache配置详解
MAMP环境配置
ajax 设置Access-Control-Allow-Origin实现跨域访问
Git常用命令
ThinkPHP3.2.3批量执行sql语句(带事务)
MySQL 百万级分页优化(Mysql千万级快速分页)
zabbix server端与agent端源码安装 自定义监控项
Tomcat多实例集群架构 安全优化和性能优化
Tomcat安装应用部署及配置文件解读
原文地址:https://www.cnblogs.com/cl1024cl/p/6204980.html
最新文章
J2EE简单的分页器
ubuntu httpie使用方法
ubuntu连接window系统
ubuntu修改中文文件夹名字为英文
jquery.autocomplete自动补全功能
Solve Hibernate Lazy-Init issue with hibernate.enable_lazy_load_no_trans
SpringMvc流程
Spring <context:component-scan>标签属性 use-default-filters 以及子标签 include-filter使用说明
Spring @Conditional简单使用 以及 使用时注意事项一点
Java @Repeatable
热门文章
Spring 注解方式引入配置文件
Spring Import注解
Cglib invoke以及invokeSuper的一点区别
Spring注解 @Configuration
Spring读取配置文件 @Value
Spring事务传播属性介绍(二).mandatory、not_supported、never、supports
Spring事务传播属性介绍(一).required 和 reuqires_new
PHP获取客户端的IP、地理信息、浏览器、本地真实IP
让Apache支持URL重写
wamp配置局域网访问
Copyright © 2011-2022 走看看