C#
snippet
ListView

[C#] リストビューで、SelectedIndex = ID 風

More than 1 year has passed since last update.
private void setListViewSelectedIndex(int sel_id)
{
    if (sel_id < 0 || sel_id >= this.listView1.Items) return;

    this.listView1.SelectedIndices.Clear();
    this.listView1.Items[sel_id].Focused = true;
    this.listView1.Items[sel_id].Selected = true;
}