How to get the screen position of Visual Studio UI Elements?

339 views Asked by At

I am developing a Visual Studio Extension.

Is there any way to get the position of the IDE's UI Elements?

So for example I would need the screen coordinates of a toolbar item like the Run Application - Button.

As far as I see the corresponding UI Element Classes of the Visual Studio SDK do not provide any position properties...

1

There are 1 answers

0
Sergey Vlasov On BEST ANSWER

Visual Studio UI is WPF, so you can use System.Windows.Media.VisualTreeHelper to enumerate and locate UI elements.