private void SelectListItem(DetailsListView LView , int[] Index, int focusedIndex, int selectionMarkIndex)
{
//複数
Rectangle bnd = new Rectangle();
bool flg = false;
var item = LView.FocusedItem;
if (item != null)
{
bnd = item.Bounds;
flg = true;
}
if (Index != null)
{
do
{
LView.SelectedIndices.Clear();
}
while (LView.SelectedIndices.Count > 0);
LView.SelectItems(Index);
}
if (selectionMarkIndex > -1 && LView.VirtualListSize > selectionMarkIndex)
{
LView.SelectionMark = selectionMarkIndex;
}
if (focusedIndex > -1 && LView.VirtualListSize > focusedIndex)
{
LView.Items[focusedIndex].Focused = true;
}
else if (Index != null && Index.Length != 0)
{
LView.Items[Index.Last()].Focused = true;
}
if (flg) LView.Invalidate(bnd);
}