How to add tooltip to all controls in a form programmatically - WPF, C#?
===

![enter image description here][1]


  [1]: http://i.stack.imgur.com/LKPUn.png

I have a WPF Form with different types of control like textboxes, textblocks, combobox, buttons etc. I need to add tooltips to each of these controls dynamically using C#, so that they can display the following information:

1. X and Y position
2. TabIndex.

I do the code as below for each control as below (code for textbox for now):

     foreach (Control ctrl in grd.Children)
            {
                if (ctrl.GetType().ToString() == "System.Controls.TextBox")
                {
                    tbox = ctrl as TextBox;
                    Point p = Mouse.GetPosition(tbox);
                    tbox.ToolTip =p.X + " " + p.Y + " \n " + tbox.TabIndex ;
                }
            }

 

But this is not working. Any thoughts?