Fix ArgumentOutOfRangeException exception when removing a not focused item
authorSebastian <asamk@gmx.de>
Tue, 18 Oct 2016 18:19:45 +0000 (20:19 +0200)
committerSebastian <asamk@gmx.de>
Tue, 18 Oct 2016 18:19:45 +0000 (20:19 +0200)
commit59f78905ffd8f223307a49bef3580b22bb00a4fa
treebd91a9f5887412feb96679fe24d87430d21cc71e
parentb7c10f90f419aac9e79b9ea88ece3e5ab3ecfba4
Fix ArgumentOutOfRangeException exception when removing a not focused item

The code in RemoveAt doesn't update the focused item index, if the focused
item is the last item in the list and another item is removed.
The next time an item is removed, the focused item index is equal to Count
and an ArgumentOutOfRangeException is thrown.
mcs/class/System.Windows.Forms/System.Windows.Forms/ListView.cs