0

I'm creating a VsPackage with a ToolWindow and having an issue setting the default position of the window when it is opened for the first time. I need it docked as a new tab in the 'main window' (not exactly sure what this is called - it is the center area of the IDE where the Code Editor window opens by default.), but instead, it is opening as a floating window on in the top-left.

I understand I can move the window to the right position and it will be saved for the next time in my settings, but I would like it defaulted to this position so the users don't have to do this.

[ProvideToolWindow(typeof(MyToolWindow),
        Style = Microsoft.VisualStudio.Shell.VsDockStyle.Linked,
        Window = "GUID Here")]

I know I have to set a specific guid, but I can't seem to find the right one - this list doesn't seem to list what I need: https://msdn.microsoft.com/en-us/library/microsoft.visualstudio.shell.interop.toolwindowguids_fields(v=vs.140).aspx

bwalker
  • 73
  • 1
  • 5

1 Answers1

1

You should use Style = VsDockStyle.MDI.

Sergey Vlasov
  • 26,641
  • 3
  • 64
  • 66
  • Could you explain why? – d4Rk Aug 28 '15 at 09:58
  • This worked! I kind of thought the 'main area' wasn't technically a window, but something else. New code: ` [ProvideToolWindow(typeof(MyToolWindow), Style = Microsoft.VisualStudio.Shell.VsDockStyle.MDI)]` – bwalker Aug 28 '15 at 18:42