ListView无法忍受 [英] ListView Unbearable
问题描述
还有其他人注意到ListView的难以忍受的闪烁吗?
我有一个包含列表视图的项目,其中包含以下内容:
- 查看:详细信息
- 列:5
以下代码导致列表视图闪烁:
private void TestListView()
{
const int Num = 20;
const string Text =" Test";
listView.BeginUpdate();
listView.Items.Clear();
ListViewItem [] items = new ListViewItem [Num];
for(int i = 0; i< items.Length; ++ i){
ListViewItem item = new ListViewItem(Text);
item.SubItems.Add(Text);
items [i] = item;
}
listView.Items.AddRange(items);
listView.EndUpdate();
}
它貌似.NET让我再次失望;由于这个原因,我可能不得不为项目使用另一个
框架。
Has anyone else noticed ListView''s unbearable flickering?
I have a project containing a list-view with the following:
- View: Details
- Columns: 5
The following code causes the list-view to flicker:
private void TestListView()
{
const int Num = 20;
const string Text = "Test";
listView.BeginUpdate();
listView.Items.Clear();
ListViewItem[] items = new ListViewItem[Num];
for (int i = 0; i < items.Length; ++i) {
ListViewItem item = new ListViewItem(Text);
item.SubItems.Add(Text);
items[i] = item;
}
listView.Items.AddRange(items);
listView.EndUpdate();
}
It looks like .NET let me down again; I might have to use another
framework for the project due to this.
推荐答案
2004年3月1日星期一01 :15:31 +0000,C#Learner< cs **** @ learner.here>写道:
On Mon, 01 Mar 2004 01:15:31 +0000, C# Learner <cs****@learner.here> wrote:
有没有其他人注意到ListView的无法忍受的闪烁?
我有一个包含列表视图的项目,其中包含以下内容:
- 查看:详细信息
- 列:5
以下代码导致列表视图闪烁:
private void TestListView()
{
const int Num = 20;
const string Text =" Test";
listView.BeginUpdate();
listView.Items.Clear( ); ListViewItem [] items = new ListViewItem [Num];
for(int i = 0; i< items.Length; ++ i){
ListViewItem item = new ListViewItem(Text);
item.SubItems.Add(Text);
items [i] = item;
}
listView.Items.AddRange(项目);
listView.EndUpdate();
}
看起来.NET让我再次失望;由于这个原因,我可能不得不为项目使用另一个
框架。
Has anyone else noticed ListView''s unbearable flickering?
I have a project containing a list-view with the following:
- View: Details
- Columns: 5
The following code causes the list-view to flicker:
private void TestListView()
{
const int Num = 20;
const string Text = "Test";
listView.BeginUpdate();
listView.Items.Clear();
ListViewItem[] items = new ListViewItem[Num];
for (int i = 0; i < items.Length; ++i) {
ListViewItem item = new ListViewItem(Text);
item.SubItems.Add(Text);
items[i] = item;
}
listView.Items.AddRange(items);
listView.EndUpdate();
}
It looks like .NET let me down again; I might have to use another
framework for the project due to this.
我是.NET的新手,所以我没玩过还有,但是当我遇到问题
在其他环境中闪烁时,我通常可以找到一些方法来转换
更新它以消除闪烁。在Access中,
将是< form> .Painting = False ...做东西......< form> .Paining = True。
I''m new to .NET, so I haven''t played with that yet, but when I have problems
with flickering in other environments, I can usually find some way to turn
painting off while updating it to get rid of the flickering. In Access, that
would be <form>.Painting = False ... do stuff ... <form>.Paining = True.
>
Steve Jorgensen写道:
Steve Jorgensen wrote:
我是.NET的新手,所以我还没玩过,但当我遇到问题时
在其他环境中闪烁,我通常可以找到一些方法来关闭绘画,同时更新它以摆脱闪烁。在Access中,
将是< form> .Painting = False ...做东西......< form> .Paining = True。
I''m new to .NET, so I haven''t played with that yet, but when I have problems
with flickering in other environments, I can usually find some way to turn
painting off while updating it to get rid of the flickering. In Access, that
would be <form>.Painting = False ... do stuff ... <form>.Paining = True.
是的,这就是ListView.BeingUpdate()和ListView.EndUpdate()在这里做的
。 .NET可能非常VCL-ish。
Yeah, that''s what ListView.BeingUpdate() and ListView.EndUpdate() do
here. .NET can be very VCL-ish.
首先我添加了microsoft.public.dotnet.framework.windowsforms.con trols
这是因为它不是C#问题。
你究竟看到了什么以及这款新的
PC的具体规格是什么?我已经在下面运行你的代码并且闪电般快速(Athlon 2600 /
Radeon 9700 Pro),20个,50个甚至1000个项目。
Richard
-
C#,.NET和复杂自适应系统:
http://blogs.geekdojo.net/Richard
" C#Learner" < CS **** @ learner.here>在消息中写道
新闻:Og ************** @ tk2msftngp13.phx.gbl ...
First I''ve added microsoft.public.dotnet.framework.windowsforms.con trols
this to thread because it''s not a C# issue.
What exactly are you seeing and what exactly are the specs of your this new
PC? I have run your code below and it was lightning fast (Athlon 2600 /
Radeon 9700 Pro) for 20, 50 even 1000 items.
Richard
--
C#, .NET and Complex Adaptive Systems:
http://blogs.geekdojo.net/Richard
"C# Learner" <cs****@learner.here> wrote in message
news:Og**************@tk2msftngp13.phx.gbl...
有没有其他人注意到ListView难以忍受的闪烁?
我有一个包含以下列表视图的项目:
- 查看:详情
- 栏目:5
>以下代码导致列表视图闪烁:
private void TestListView()
{
const int Num = 20;
const string Text ="测试" ;;
listView.BeginUpdate();
listView.Items.Clear();
ListViewItem [] items = new ListViewItem [Num ];
for(int i = 0; i< items.Length; ++ i){
ListViewItem item = new ListViewItem(Text);
item.SubItems.Add(Text) ;
items [i] = item;
}
listView.Items.AddRange(items);
listView.EndUpdate();
}
看起来.NET让我再次失望;由于这个原因,我可能不得不为项目使用另一个
框架。
Has anyone else noticed ListView''s unbearable flickering?
I have a project containing a list-view with the following:
- View: Details
- Columns: 5
The following code causes the list-view to flicker:
private void TestListView()
{
const int Num = 20;
const string Text = "Test";
listView.BeginUpdate();
listView.Items.Clear();
ListViewItem[] items = new ListViewItem[Num];
for (int i = 0; i < items.Length; ++i) {
ListViewItem item = new ListViewItem(Text);
item.SubItems.Add(Text);
items[i] = item;
}
listView.Items.AddRange(items);
listView.EndUpdate();
}
It looks like .NET let me down again; I might have to use another
framework for the project due to this.
这篇关于ListView无法忍受的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!