473,699 Members | 2,302 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.Collecti ons;

using System.Componen tModel;

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.ColumnHea der columnHeader1;

/// <summary>

/// Required designer variable.

/// </summary>

private System.Componen tModel.Containe r components = null;

public Form1()

{

//

// Required for Windows Form Designer support

//

InitializeCompo nent();

//

// TODO: Add any constructor code after InitializeCompo nent call

//

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

{

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

listView1.Items .Add(listViewIt em);

}

}

/// <summary>

/// Clean up any resources being used.

/// </summary>

protected override void Dispose( bool disposing )

{

if( disposing )

{

if (components != null)

{

components.Disp ose();

}

}

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 InitializeCompo nent()

{

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

this.columnHead er1 = new System.Windows. Forms.ColumnHea der();

this.SuspendLay out();

//

// listView1

//

this.listView1. Columns.AddRang e(new System.Windows. Forms.ColumnHea der[] {

this.columnHead er1});

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.Deta ils;

//

// columnHeader1

//

this.columnHead er1.Width = 124;

//

// Form1

//

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

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

this.Controls.A dd(this.listVie w1);

this.Name = "Form1";

this.Text = "Form1";

this.ResumeLayo ut(false);

}

#endregion

/// <summary>

/// The main entry point for the application.

/// </summary>

[STAThread]

static void Main()

{

Application.Run (new Form1());

}

}

}
Jul 22 '05 #1
0 941

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
4754
by: David Miller | last post by:
Hello, I posted this to DotNet.Framework.Controls a week ago or so and got no response, so now I will repost it here to see if anyone here knows anything about it... I have an application that displays items in a ListView control that is running on a Windows 98 SE machine. The machine is well within system specifications for the .Net Framework. It is a 600 MHz with 128 MB of RAM, and also has the Resource Meter application installed....
2
5068
by: ashley | last post by:
How do i detect that the vertical scroll bar has been moved and how do i get the vertical scrollbar value from a listview. I need to do this to synchronise a textbox movement within the listview.
4
2335
by: John Dann | last post by:
I have a listview control on a simple vb.net form that's populated programmatically. It is set to scrollable and a scroll bar duly appears. However the scroll bar doesn't allow the bottom rows of the list to be seen. For example, if I have 31 rows in the list with the control set to a height that shows maybe 20 rows then the scroll bar allows me to get down to eg row 28 as the bottom row, but not row 31. Yet if I drag the bottom of the...
12
7483
by: J L | last post by:
When I fill a listview, I resize the columns to fit the data. I need to know if the data will fit vertically or if there will be a vertical scroll bar. I need to know this so I can allow for it on the overall size of the listview. My question therefore is, how can I tell if the items I have added will fit in the listview at its given height? A secondary one, just for interest sake...is there a way to determine the exact heght needed...
2
6913
by: | last post by:
Hi All, How can I get to scroll bars of a listview, I am trying to sync two listviews so I need to overload one of the listview, How can I achieve this ? Thank You.
0
1863
by: alcurb | last post by:
I have a ListView control populated with 30 items. ListView height only allows you to see 20 rows at a time. I want to drag an item to the bottom of the list (to the last row), but ListView control doesn't automatically scroll as my mouse leaves the bottom edge of the control. Also if I'm dragging an item from the last row to the top row, ListView doesn't scroll. Please, please, please tell me how to make it scroll while dragging an item....
6
4317
by: Mike Johnson | last post by:
I have a ListView on a form, I'm displaying the items as a list. The Scroll is set to true. I want to know how can I set the scroll bar to Vertical?
0
1716
by: Jarppi | last post by:
Hi All, Not sure how to go about this one. I've got a windows form with five ListView controls, each listing the files in a seperate folder. What I want to achieve is this: When I scroll any of the ListView controls, I'd like the other ListView controls to scroll to the same position. I've check, but cannot find a Scrolling or Scroll event on a ListView control. I thought about catching the MouseWheel event, but this will
7
2340
by: Liz | last post by:
My ListView components seem to produce distortion when they are scrolled in Details view; it looks almost like the text has a "strike-through" attribute applied to it. Does anyone know of a fix for this? If not, is there an alternative component available (that behaves like a ListView) ? TIA L
5
10113
by: Lord Zoltar | last post by:
Hello, I'm trying to force a listView to scroll to some location when a certain button is clicked on. I've found that the SendMessage function seems to be the choice way of doing it. Here's what I've put in my button handler: //somewhere else in my code: private const int WM_VSCROLL = 277; // Vertical scroll .. ..
0
8618
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9178
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9035
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8916
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7752
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5875
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4631
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2348
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2010
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.