Scrolling ListView with mouse wheel sometimes cancels scrolling

I have problems viewing a Win32 list, and I hope someone has wisdom. With very fast scrolling (using the wheel), sometimes the list view is displayed for scrolling, only to return to the selected item so that it is in view. In other words, the list cancels the scroll wheel to show the selected item at the top / bottom of the list. I understand that this sounds very doubtful, since the general control has been beaten to death all over the world.

Here's how you can repeat it:

  1. Download a list view in report mode with approximately 500 elements (the exact value does not matter, you just need several data screens).
  2. Select an item from the list and remember what you have selected.
  3. Quickly scroll the list with the wheel down (toward you). We are trying to scroll the selected item as quickly as possible. You should probably use more power than you usually use on the wheel. This does not always happen. You may need to try several times.
  4. Either the scroll will end normally, or it will change its mind at the end and return you back to where the selected item is on the screen.

This happens with both regular and virtual lists. I tested Win32 and C # on Windows 7 Ultimate.

I made a small WinForms application that demonstrates behavior (requires .NET Framework 3.5). If you do not want to run arbitrary executable files from strangers (as I understand it), create a new WinForms application, delete the list view in report mode, add a column and fill the list in the form load event with 500 increasing integers:

private void Form1_Load(object sender, EventArgs e) { for (int i = 0; i < 500; i++) { this.listView1.Items.Add(i.ToString()); } } 
+5
source share
4 answers

I noticed this behavior, and it seems to be built into the list view control. I see no reason why the functionality would be useful. I created a thread on this in the Sysinternals Forums a while ago. This may be helpful.

+1
source

"I understand that this sounds very doubtful, since general controls have been beaten around the world."

ListView was not completely beaten to death, but it supported life. Use a different control.

0
source

- this is a custom list (overriding a drawing?) by the way, I ran into (as I understand) the same problem with a custom Listbox and found some help here:

http://aviationxchange.net/wikis/winforms/net-color-listbox.aspx (end of document).

Hope this helps.

0
source

I ran into the same problem, but I think I found the reason: I use a tool that allows you to customize the mouse buttons (control the X-Mouse buttons). By turning it off, the problem disappeared as if by magic.

0
source

Source: https://habr.com/ru/post/1300264/


All Articles