I am trying to change the cursor that appears in the standard ListView when the cursor appears above the item. However, I get a flickering effect when the mouse is changed to a finger pointer, and then back to what I asked.
I am trying to isolate this flicker / change on a hand cursor, but cannot figure out where it is happening or how to stop it. To reproduce this ...
1) Create a form with a ListView on it. 2) Add a list of images and some images. Set the view mode to a large icon. 3) Add some items to the ListView.
Add the MouseMove to the ListView :
private void listView1_MouseMove(object sender, MouseEventArgs e) { ListViewItem selected = this.listView1.GetItemAt(eX, eY); if (selected == null) { base.Cursor = Cursors.Default; } else { base.Cursor = Cursors.No; } }
Running an application, moving the mouse over an item. You should see that the cursor flickers between No (no entry cursor) and the finger pointer when you are above the element. The question is how to make sure that it simply displays a No cursor and does not flicker. (C # .NET).
I tried to override both OnMouseMove and OnMouseHover to return to ensure that they do not install anything. I also tried to override the Cursor property and say "only the default or no cursors", and that didn't work either.
Any help was appreciated.
Yang
source share