winform listview默认第一项光标选中

 if (this.lsvSortingHeadList.Items.Count > 0)
{
this.lsvSortingHeadList.Focus();
this.lsvSortingHeadList.Items[0].Selected = true;
//this.lsvSortingHeadList.HideSelection = false;
//this.lsvSortingHeadList.FocusedItem = this.lsvSortingHeadList.Items[0];
//this.lsvSortingHeadList.Items[0].Focused = true;
}

只有上面的代码才能让第一项高亮并且有焦点选中。

上一篇:topcoder srm 706 div1


下一篇:Java 基础类型 默认值