how do you call the function? What event is raised to call the function?
if the function is called when the box is changed; your code should work I guess. If you need to press a button to update the field i'd use this code:
foreach (ListViewItem in listView1)
{
ListViewItem find_name = listView1.FindItemWithText(textBox1.Text);
if(find_name!=null)
{
find_name.BackColor = Color.DarkViolet;
}
else
{
MessageBox.Show("No Records Found");
textBox1.Text = "";
find_name.BackColor = Color.White;
}
}