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;
            }

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

posted @ 2015-03-06 09:35  跟着阿笨一起玩.NET  阅读(2783)  评论(0编辑  收藏  举报