0
When the component was clicked but my intention is to remove this color blue half red if you use the zoom will notice these two color
I’ve tried all kinds of things but click it gets this color already look to remove this color from the selection in Design Visual Studio but n has the box showing the color of the node etc... I found nothing related to it.
private void treeView1_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
{
string nomeespecifico = e.Node.Text;
foreach (var a in nodes)
{
treeView1.HideSelection = false;
treeView1.SelectedNode = null;
if (a.Text == nomeespecifico ){
if (e.Button == MouseButtons.Right)
{
a.ForeColor = Color.Blue;
a.BackColor = Color.Transparent;
Console.WriteLine($"fui clicado direito {a.Text}");
}
else if (e.Button == MouseButtons.Left) {
treeView1.SelectedNode = a;
a.BackColor = Color.Transparent;
a.ForeColor = Color.Red;
Console.WriteLine($"fui clicado esquerdo {a.Text}");
}
}
}
}
private void treeView1_NodeMouseHover(object sender, TreeNodeMouseHoverEventArgs e)
{
selNode =
(TreeNode)treeView1.GetNodeAt(treeView1.
PointToClient(Cursor.Position));
if (selNode != null)
{
// faz a seleção ao automático quando o mouse passa pelo nó
selNode.BackColor = Color.Transparent;
selNode.ForeColor = Color.Blue;
}
Console.WriteLine("NodeMouseHover");
}