How can I set the caption on an editor window in Visual Studio

502 Views Asked by At

I have implemented an annotate function in the Visual Studio Extension AnkhSVN2019 using a custom margin on an editor window.

In the current version, the tab on the editor window just contains the filename, and looks identical to a normal editor window. I would like to modify the caption, for example by appending the word "Annotated".

I am opening the editor window with

dte.ItemOperations.OpenFile

In the margin factory, I get the interface IWpfTextViewHost.

How can I modify the caption in the tab?

1

There are 1 best solutions below

1
Bohdan On

You can implement your own Microsoft.VisualStudio.PlatformUI.Shell.ViewElementFactory from <VS installation>\Common7\IDE\Microsoft.VisualStudio.Shell.ViewManager.dll to overide the tab appearance i.e. showing the caption as you wish.

Look at VSTabPath extension code for inspiration.