Update ListViewFlickerFree.cs

pull/2510/head
2dust 2022-07-29 20:59:12 +08:00
parent a5e9edb2e5
commit 5aa27c14c6
1 changed files with 15 additions and 0 deletions

View File

@ -93,5 +93,20 @@ namespace v2rayN.Base
DoDragDrop(e.Item, DragDropEffects.Move); DoDragDrop(e.Item, DragDropEffects.Move);
InsertionMark.Index = -1; InsertionMark.Index = -1;
} }
public void SetScrollPosition(int pos)
{
pos = Math.Min(Items.Count - 1, pos);
if (pos < 0 || pos >= Items.Count)
return;
EnsureVisible(pos);
for (int i = 0; i < 10; i++)
{
if (TopItem != null && TopItem.Index != pos)
TopItem = Items[pos];
}
}
} }
} }