Hi
below are the code in treeview ,i want change the color of node
in treeview which is found while searching
private void button1_Click(object sender, EventArgs e)
{
TreeNode oMainNode = treeView1.Nodes[0];
PrintNodesRecursive(oMainNode);
}
///////////
public void PrintNodesRecursive(TreeNode oParentNode)
{
foreach (TreeNode oSubNode in oParentNode.Nodes)
{
if (oSubNode.Text == textBox1.Text)
{
found = true;
oSubNode.BackColor = Color.Red;
oSubNode.BackColor = treeView1.BackColor;// this.BackColor = System.Drawing.Color.DarkBlue;
}
else
{
PrintNodesRecursive1(oSubNode);
}
}
if(found == true)
{
MessageBox.Show("node found");
}
else
{
MessageBox.Show("NODE NOT found");
}
}
//////////////
public void PrintNodesRecursive1(TreeNode oParentNode)
{
foreach (TreeNode oSubNode in oParentNode.Nodes)
{
if (oSubNode.Text == textBox1.Text)
{
found = true;
}
}
}
please help me