Visual Studio Developer Center > Visual Studio Forums > Visual Studio Extensibility > Add-In ToolWindow not saing its dock state, position, size
Ask a questionAsk a question
 

QuestionAdd-In ToolWindow not saing its dock state, position, size

  • Sunday, November 08, 2009 2:30 AMcodetale Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    i create the toolwindow with Windows2.CreateToolWindow2
    when the OnStartupComplete call

    if i never open/create a solution/project but immedialy exit the VS after setting(drag and drop) it's dock/position/size
    the state is saved and restore next time i start the VS

    but it is not, when I exit the VS after create/open any project/solution

    any idea?

    thank you very much

All Replies

  • Monday, November 09, 2009 9:00 AMWesley YaoMSFT, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hello,

    Unfortunately, I tried it in VS2008 but cannot reproduce this problem.
    Could you please tell me which version of VS you are trying? and show me some code of the ToolWindow's creation.

    Thanks,
    Wesley
    Please 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.
  • Tuesday, November 10, 2009 3:24 AMcodetale Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Has Code
    object programmableObject = null;
    string guidString = "{ED965D4A-C724-404e-A513-F93A06A9DDD1}";
    Windows2 windows2 = (Windows2)_applicationObject.Windows;
    Assembly asm = Assembly.GetExecutingAssembly();
    
    this.panel = windows2.CreateToolWindow2(_addInInstance, asm.Location, "VSAddins.Viewer", "Viewer", guidString, ref programmableObject);
    
    here the code how i create the toolwindow

    the VSAddins.Viewer are extend of UserControl

    I not sure why, but it seem the creator of Ora also met this problem
    http://www.codeplex.com/ora

    the problem in short, the custom created tool window not saved it position and dock state

    thankyou very much
  • Tuesday, November 10, 2009 8:20 AMWesley YaoMSFT, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hello,

    Thanks for your information.
    Your code looks the same with what I tried, it's odd that I cannot reproduce it but the Ora toolwindows does.  I will investigate the Ora, if I find anything, I will let you know.

    Sincerely,
    Wesley
    Please 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.
  • Tuesday, November 10, 2009 1:23 PMCarlos Quintero - MVPMVP, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hello,

    First, ensure that you are using the OnConnection / OnStartupComplete methods correctly:

    HOWTO: Use correctly the OnConnection method of a Visual Studio add-in
    http://www.mztools.com/articles/2008/MZ2008004.aspx

    Then, apparently your code is correct (you are using the same Guid). So, could you post the whole code of your OnConnection / OnStartupComplete methods to see if you are missing something?

    MZ-Tools: Productivity add-ins for Visual Studio: http://www.mztools.com. My blog about VS extensibility: http://msmvps.com/blogs/carlosq/