471,310 Members | 1,382 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,310 software developers and data experts.

ListView scroll bug

When I add several items, 4000, to a ListView and rapidly move the vertical
scroll bar from top to bottom several times with the mouse over a period of
about 20 seconds, the ListView control seems to hang on redraw. Doing a
Debug -> Break All halts the app but of course the call stack indicates that
it is in non-user code. This happen in Debug and Release builds and in and
outside the debugger.

I'm using .NET 1.1
WinXP SP 2

Has anyone seen this before?
Here's the code:

using System;

using System.Drawing;

using System.Collections;

using System.ComponentModel;

using System.Windows.Forms;

using System.Data;

namespace TestListView

{

/// <summary>

/// Summary description for Form1.

/// </summary>

public class Form1 : System.Windows.Forms.Form

{

private System.Windows.Forms.ListView listView1;

private System.Windows.Forms.ColumnHeader columnHeader1;

/// <summary>

/// Required designer variable.

/// </summary>

private System.ComponentModel.Container components = null;

public Form1()

{

//

// Required for Windows Form Designer support

//

InitializeComponent();

//

// TODO: Add any constructor code after InitializeComponent call

//

for (int i = 0; i < 4000; ++i)

{

ListViewItem listViewItem = new ListViewItem(i.ToString());

listView1.Items.Add(listViewItem);

}

}

/// <summary>

/// Clean up any resources being used.

/// </summary>

protected override void Dispose( bool disposing )

{

if( disposing )

{

if (components != null)

{

components.Dispose();

}

}

base.Dispose( disposing );

}

#region Windows Form Designer generated code

/// <summary>

/// Required method for Designer support - do not modify

/// the contents of this method with the code editor.

/// </summary>

private void InitializeComponent()

{

this.listView1 = new System.Windows.Forms.ListView();

this.columnHeader1 = new System.Windows.Forms.ColumnHeader();

this.SuspendLayout();

//

// listView1

//

this.listView1.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {

this.columnHeader1});

this.listView1.Dock = System.Windows.Forms.DockStyle.Fill;

this.listView1.Location = new System.Drawing.Point(0, 0);

this.listView1.Name = "listView1";

this.listView1.Size = new System.Drawing.Size(472, 702);

this.listView1.TabIndex = 0;

this.listView1.View = System.Windows.Forms.View.Details;

//

// columnHeader1

//

this.columnHeader1.Width = 124;

//

// Form1

//

this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);

this.ClientSize = new System.Drawing.Size(472, 702);

this.Controls.Add(this.listView1);

this.Name = "Form1";

this.Text = "Form1";

this.ResumeLayout(false);

}

#endregion

/// <summary>

/// The main entry point for the application.

/// </summary>

[STAThread]

static void Main()

{

Application.Run(new Form1());

}

}

}
Jul 22 '05 #1
0 876

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by David Miller | last post: by
2 posts views Thread by ashley | last post: by
4 posts views Thread by John Dann | last post: by
12 posts views Thread by J L | last post: by
2 posts views Thread by | last post: by
6 posts views Thread by Mike Johnson | last post: by
7 posts views Thread by Liz | last post: by
5 posts views Thread by Lord Zoltar | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.