I am writing an addin into Sql Server Management Studio, using the Visual Studio Extensibilty APIs. I have had some success overlaying a control onto the text surface (I'm attempting to emulate the CodeRush/Refactor action list, similar to the intellisense combo), however I can only locate it's coordinate space based the following property:
get
{
var point = TextDocument.Selection.TopPoint;
return new Cursor( point.DisplayColumn, point.Line );
}
This code does allow me to then convert cols/rows into pixels, however I can not find a way to offset the cols/rows when the text editor has been scrolled either vertically or horizontally. This causes the listbox to disappear below the visible screen space.
What I am looking for is a method of getting the screen coordinates from the current col/row pair, so that I can place the listbox next to the cursor, regardless of the scrolled position.