楼上的能不能说详细点呀。
比如。1234567
      1245678
      1245790
当txt_change中打入12时﹐高亮度第一行,续继打入4时(即124)第一行不再高亮度显示﹐第二条高亮度了.。。

解决方案 »

  1.   

    for(i=0;i<this.Lsv.Items.Count;i++)
    {
    if(Lsv.Items[i].SubItems[0].Text.IndexOf(this.textBox1.Text.Trim())>=0||Lsv.Items[i].SubItems[1].Text.IndexOf(this.textBox1.Text.Trim())>=0)
    {
    if(first)
    {
    this.Lsv.Items[i].Focused= true;
    this.Lsv.Items[i].Selected= true;
    this.Lsv.Items[i].EnsureVisible();
    first= false;
    }
    else
    {
    this.Lsv.Items[i].BackColor = Color.DeepSkyBlue;
    }
    }
    }
      

  2.   

    chenxy2002() 再看一下問題出在哪里呀﹐這個貼子我想我可以加到500分。決不食言
    bool first=true;
    for(int i=0;i<listView1.Items.Count ;i++)
    {

    if(listView1.Items[i].Text.IndexOf(textBox6.Text.Trim ())>=0)
    {
    if( first)
    {
    listView1.Items [i].Focused=true;
    listView1.Items[i].Selected=true;
    listView1.Items [i].EnsureVisible();
    this.listView1.Items[i].BackColor = Color.DeepSkyBlue;//选定状态﹐为蓝色
    first=false;
    }
    else
    {
    this.listView1.Items[i].BackColor =Color.White ;
    }
    }
    }
    但第一条记录总是为选定状态﹐为蓝色﹐其它行都正常﹐焦点离开之后﹐不再选中﹐不再以蓝色标识﹐但第一条﹐永远都是蓝色。。
    不知说清楚没有.
      

  3.   

    看能否帮你http://expert.csdn.net/Expert/topic/1444/1444905.xml?temp=.5755426
      

  4.   

    试试,我在BS架构下实现了。
    listView1.SelectedIndex = i
      

  5.   

    搞不定就人为的将它设为不选中
    listView1.Items[0].Selected= false;
    listView1.Items[0].Focused= false;
    listView1.Items[0].BackColor= Color.White;