Hi,
I have created a tool window using CreateToolWindow2 in VS2012:
mWindow = (Window2)toolWins.CreateToolWindow2(
mAddin, asmPath, ctrlClsName, title, guid, ref objTemp);
mWindow.Caption = QA_EX_WIN_TITLE;
mWindow.Visible = true;
The class name refers to a trivial WPF user control that has a single label on it.
The tool window is created ok and it has the correct name in its title bar but when it is docked with tabs such as solution explorer its tab has no name.
I have tracked down the property that it is using to display the tab name by navigating from the WPF control to its parent (a Microsoft.VisualStudio.Platform.WindowManagement.ToolWindowView), which has a Title property of type Microsoft.VisualStudio.Platform.WindowManagement.WindowFrameTitle, which has a ShortTitle property of type string that is empty. If I break in the debugger after creating the tool window and set this ShortTitle property to the desired value manually by typing into the watch window then then the tool window's tab is shown with the correct text.
The question is - where is this ShortTitle property populated from?
As a test, I tried wrapping the WPF user control in a WinForms user control using the WindowsFormsHost. This produces a tab with the correct name but obviously loses all the WPF visual styles so is not a satisfactory solution.
I can write some code that updates ShortTitle directly after creating the tool window but it would be much better to correctly set up whatever ToolWindowView is using to populate the ShortTitle property in the first place.
Any advice gratefully received :)
Jeremy