I am writing addin in Sql Server Management Studio using the Visual Studio Extensibilty API. I had some success overlaying a control on a text surface (I'm trying to emulate a CodeRush / Refactor action list similar to the intellisense command), however I can find its coordinate space based on the following property:
get
{
var point = TextDocument.Selection.TopPoint;
return new Cursor( point.DisplayColumn, point.Line );
}
This code allows me to convert cols / rows to pixels, however I cannot find a way to offset cols / rows when the text editor scrolls either vertically or horizontally. This will cause the list to disappear under the visible space of the screen.
What I'm looking for is a method to get the screen coordinates from the current col / row pair, so that I can place the list next to the cursor, regardless of the scroll position.
source
share