ListView控件如何默认选中第一个元素

private void tabControl1_SelectedIndexChanged(object sender, EventArgs e)
{
if (tabControl1.SelectedIndex == 1&&listView1.Items.Count>0)
{
//默认选中第一行数据
listView1.Items[0].Selected = true;
listView1.Select();
}
}

猜你喜欢

转载自www.cnblogs.com/sharestone/p/9019181.html