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