locked
Tool window not docking- VSPackage- vs 2008 RRS feed

  • Question

  • Hi,

    i am developing a VSPackage in VS 2008.

    I have created a toolwindow and few tabs in that tool window.

    I have used the ProvideToolWindowAttribute to provide tool window information.

    [ProvideToolWindow(typeof(MyToolWindow), Style = VsDockStyle.Tabbed, Orientation = ToolWindowOrientation.Bottom, Window = "3ae79031-e1bc-11d0-8f78-00a0c9110057")]

    i want the tool window to be docked to the location where the errors list / output window appears. If there are any other window open along with my packages tool window, i want them to be tabbed with the tool window created.

    With the above attribute i am not able to dock the tool window to the IDE. it always appears to be floating after the package installation.

    I have used the following in the Initialize function:

    windowFrame = (IVsWindowFrame)RWindowPane.Frame;

    windowFrame.SetProperty((int)__VSFPROPID.VSFPROPID_Type, VSFRAMEMODE.VSFM_Dock);

    But its of no use.

    Can anyone help me with a solution to this ?

     

    Thanks ,

    Nayna

     

     

    • Changed type Nayna Friday, June 11, 2010 9:48 AM
    Friday, June 11, 2010 9:41 AM

All replies

  • Hi Nayna,

    You can set the Window.IsFloating Property to false. See following code:

    if (this.win == null)
      this.CreateToolWindow();
    
    _applicationObject.MainWindow.LinkedWindows.Add(this.win);
    this.win.Linkable = false;
    this.win.IsFloating = false;
    

    For more information, please see following thread:

    http://social.msdn.microsoft.com/Forums/en/vsx/thread/93e90d60-4cd0-4ef8-beac-d91b9122b387

    Best Regards,

    Nancy


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    • Marked as answer by Nancy Shao Monday, June 21, 2010 4:46 AM
    • Unmarked as answer by Nayna Tuesday, June 22, 2010 6:42 AM
    Thursday, June 17, 2010 2:23 AM
  • Hi Nancy,

    Thanks for the reply.

    i am creating the tool window in VSPackage the following way:

    ReViewerWindowPane =

    this.FindToolWindow(typeof(MyToolWindow), 0, true);

    ReViewerNewWindow = (

    MyToolWindow)ReViewerWindowPane;

     

    if ((null == ReViewerWindowPane) || (null == ReViewerWindowPane.Frame))

    {

     

    throw new COMException(Resources.CanNotCreateWindow);

    }

    windowFrame = (

    IVsWindowFrame)ReViewerWindowPane.Frame;

    Microsoft.VisualStudio.

    ErrorHandler.ThrowOnFailure(windowFrame.Show());

    Is there a way i can set the floating property to false here?

     

    Thanks.

    Tuesday, June 22, 2010 6:42 AM
  • Hi Nayna,

    You can use two ways to set tool window's status when you create this tool window, one is to use ProvideToolWindow attribute, the other is use Window.IsFloating property to do this.

    Package.FindToolWindow return a ToolWindowPane type, but not Window Type, so it does not have IsFloating property.

    Best Regards,
    Nancy


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    Wednesday, June 23, 2010 2:57 AM
  • Hi Nancy,

    Thanks for the reply..

    I have used the following attribute :

    [ProvideToolWindow(typeof(MyToolWindow), Style = VsDockStyle.Tabbed, Orientation = ToolWindowOrientation.Bottom, Window = "3ae79031-e1bc-11d0-8f78-00a0c9110057")]

    The tool window is not docking to the bottom inspite of setting this property.

    Have i missed any step which is causing the issue?

    Please let me know if you need more information..

     

    Thanks,

    Nayna

    Wednesday, June 23, 2010 3:11 AM
  • Hi Nayna,

    Could you give a small sample to repro this? Have you download my sample in the link I provided in my first post, What's the difference?

     


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    Friday, June 25, 2010 9:08 AM
  • Hi Nayna,

    Have you tried resetting the IDE's window layout (Window.Reset Window Layout)? If you initially created the toolwindow (before adding the Style and Orientation attributes), or if you changed the toolwindow to float, then exited the IDE. The position gets remembered. The registry key that ProvideToolWindow sets, is only ever read when the IDE doesn't find the toolwindows last location.

    You might want to try resetting the window layout, and restart and see if that causes the toolwindow to dock along side the error list.

    Sincerely,


    Ed Dore
    Saturday, June 26, 2010 5:55 AM
  • Hi,

    Thanks for the reply..

    I am working on VSPackage in VS 2008.

    Inside the Intialize function i have created a DTE2 object:

    DTE2 RApplicationObject = (EnvDTE80.DTE2)Microsoft.VisualStudio.Shell.Package.GetGlobalService(typeof(EnvDTE.DTE));
    

    And have created a Window2 object:

    Window2 windows = (Window2)RApplicationObject.Windows;

    i am not able to find the method CreateLinkedWindowFrame in windows.

    Window2 newWindow = null;
     newWindow= (Window2)windows.

    Is there any step i have misseD?

    Thanks,

    Nayna

     

    Monday, June 28, 2010 4:22 AM