heribertolugo / FileList

List all files in a given directory, and provide the option to copy or move selected files.
1 stars 0 forks source link

Exception while scrolling TreeView #51

Closed heribertolugo closed 4 years ago

heribertolugo commented 4 years ago

index outside of bounds of array. occurred at method: FillBottomReserve().

this exception is uncommon, has only occurred once out of several dozen times using the application.

after closing exception dialog, application state remained stable and virtual scrolling resumed to function as expected.

heribertolugo commented 4 years ago

the top nodes are being removed ant the reference to top node is not being updated parent.Nodes.RemoveAt(0);

when setting the scroll position, the top node which was removed is referenced if (!scrollBarWasVisible && this.treeView1.HorizontalScrollVisible()) // our field of view shifted this.treeView1.Nodes[this.treeView1.Nodes.Find(topNode.Name, false)[0].Index + 1].EnsureVisible(); else this.treeView1.Nodes.Find(topNode.Name, false)[0].EnsureVisible();

top node needs to be updated to reflect the node which is visible count minus bottom node