C# Winform: How to display tooltips just below treeview node

T.Zacks 3,996 Reputation points
2021-12-14T16:35:27.63+00:00

I am trying to show tooltips just below treeview node but it is not positioned properly. here is a screen shot.

157505-ww.png

this is my code which is showing tooltips on the node when position mouse over treeview node. this tooltip cover actual node on which mouse is positioned. please guide me to place tooltips under the hover node.

        string tooltipmsg = "Please check." + Environment.NewLine + "Yellow background lineitem does not exist.";  
        private void tvCsmTuner_MouseMove(object sender, MouseEventArgs e)  
        {  
            TreeNode currentNode = this.tvCsmTuner.GetNodeAt(e.X, e.Y);  
            if (null != currentNode)  
            {  
                if(currentNode.BackColor==Color.Yellow)  
                {  
                    this.toolTip1.SetToolTip(tvCsmTuner, "Please check."+Environment.NewLine+"Yellow background lineitem does not exist.");  
                    //toolTip1.Show(tooltipmsg, tvCsmTuner, tvCsmTuner.PointToClient(new Point(e.Location.X, e.Location.Y)));  
                }  
                else  
                {  
                    this.toolTip1.SetToolTip(tvCsmTuner, "");  
                }  
            }  
  
        }  

I just want to place tooltips under the node which is not happening by the above code. thanks

Developer technologies C#
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.