for (int i = 0; i < ListView1.Items.Count; i++) { if (ListView1.Items[i].SubItems[0].Text.ToString() == sOrderNo) { this.ListView1.Items[i].Selected = true; //选中行 this.ListView1.EnsureVisible(i); //滚动到指定的行位置 return; } }
for (int i = 0; i < ListView1.Items.Count; i++)
{
if (ListView1.Items[i].SubItems[0].Text.ToString() == sOrderNo)
this.ListView1.Items[i].Selected = true; //选中行
this.ListView1.EnsureVisible(i); //滚动到指定的行位置
return;
}