namespace ExcelVSTOProject
{
	public partial class ThisAddIn
    {
        private void ThisAddIn_Startup(object sender, System.EventArgs e)
        {
            this.ShowUserControl();
        }

        private void ThisAddIn_Shutdown(object sender, System.EventArgs e)
        {
        }

		public void ShowUserControl()
		{
			var userControl = new WinformsUserControl();
			var customPane = this.CustomTaskPanes.Add(userControl, "Test");
			customPane.Width = userControl.Width;
			customPane.Visible = true;
		}

		#region VSTO generated code

		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InternalStartup()
        {
            this.Startup += new System.EventHandler(ThisAddIn_Startup);
            this.Shutdown += new System.EventHandler(ThisAddIn_Shutdown);
        }
        
        #endregion
    }
}
