context: //  Dungeon Master Digital Sheet
  //  Copyright (C) 2011-2012 Darkwisperer
  //  https://github.com/darkwisperer/Dungeon-Master-Sheet
  //
  //  This program is free software; you can redistribute it and/or modify
  //  it under the terms of the GNU General Public License as published by
  //  the Free Software Foundation; either version 3 of the License, or
  //  (at your option) any later version.
  //
  //  This program is distributed in the hope that it will be useful,
  //  but WITHOUT ANY WARRANTY; without even the implied warranty of
  //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  //  GNU General Public License for more details.
  //
  //  You should have received a copy of the GNU General Public License
  //  along with this program; if not, write to the Free Software
  //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  //
  //---------------------------------------------------------------------------
  
  using System;
  using System.Drawing;
  using System.Collections;
  using System.ComponentModel;
  using System.Windows.Forms;
  using System.Data;
  using MyControlLibrary;
  using System.Collections.Generic;
  using System.Drawing.Printing;
  using System.IO;
  
  namespace DM_Sheet
  {
  
  
      /// <summary>
      /// Summary description for Form1.
      /// </summary>
      public class Form1 : System.Windows.Forms.Form
      {
          private ContextMenu contextMenuStrip1;
          private MenuItem NewTab;
          private MenuItem closeAllButThisToolStripMenuItem;
          private MenuItem closeTabToolStripMenuItem;
          private MenuItem New4charTab;
          private MenuItem New3charTab;
          private MenuItem New2charTab;
          private MenuItem New1charTab;
          private CharTabPage tabPage1;
          private TabCtlEx userControl11;
          private System.ComponentModel.IContainer components;
          private Panel panel1;
          private MenuStrip menuStrip1;
          private ToolStripMenuItem fileToolStripMenuItem;
          private ToolStripMenuItem helpToolStripMenuItem;
          private ToolStripMenuItem aboutToolStripMenuItem;
          private ToolStripMenuItem newToolStripMenuItem;
          private ToolStripMenuItem fourCharacterSheetToolStripMenuItem;
          private ToolStripMenuItem loadToolStripMenuItem;
          private ToolStripMenuItem saveToolStripMenuItem;
          private ToolStripMenuItem saveToolStripMenuItem1;
          private ToolStripMenuItem exitToolStripMenuItem;
          private int tabs = 1;
          private ToolStripMenuItem ThreeCharcterSheet;
          private ToolStripMenuItem toolStripMenuItem3;
          private ToolStripMenuItem oneCharacterSheetToolStripMenuItem;
          private CharTabPage LastTabPage = null;// this is used to pre-load the base character sheet for when all sheets have been closed this new one can be substatuted to prevent visable loading of the page.
          private ToolStripMenuItem saveAsGroupToolStripMenuItem;
          private ToolStripMenuItem saveAllToolStripMenuItem;
          private ToolStripMenuItem printToolStripMenuItem;
          private PrintDocument printDocument1;
          private ToolStripSeparator toolStripSeparator1;
          private ToolStripSeparator toolStripSeparator2;
  
          private String PATH = null;
  
          public Form1()
          {
              //
              // Required for Windows Form Designer support
              //
              InitializeComponent();
  
              //
              // TODO: Add any constructor code after InitializeComponent call
              //
          }
  
          /// <summary>
          /// Clean up any resources being used.
          /// </summary>
          protected override void Dispose(bool disposing)
          {
              if (disposing)
              {
                  if (components != null)
                  {
                      components.Dispose();
                  }
              }
              base.Dispose(disposing);
          }
  
          #region Windows Form Designer generated code
          /// <summary>
          /// Required method for Designer support - do not modify
          /// the contents of this method with the code editor.
          /// </summary>
          private void InitializeComponent()
          {
              this.components = new System.ComponentModel.Container();
              System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1));
              this.contextMenuStrip1 = new System.Windows.Forms.ContextMenu();
              this.NewTab = new System.Windows.Forms.MenuItem();
              this.New4charTab = new System.Windows.Forms.MenuItem();
              this.New3charTab = new System.Windows.Forms.MenuItem();
              this.New2charTab = new System.Windows.Forms.MenuItem();
              this.New1charTab = new System.Windows.Forms.MenuItem();
              this.closeAllButThisToolStripMenuItem = new System.Windows.Forms.MenuItem();
              this.closeTabToolStripMenuItem = new System.Windows.Forms.MenuItem();
              this.panel1 = new System.Windows.Forms.Panel();
              this.userControl11 = new MyControlLibrary.TabCtlEx();
              this.tabPage1 = new MyControlLibrary.CharTabPage(this.components);
              this.menuStrip1 = new System.Windows.Forms.MenuStrip();
              this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
              this.newToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
              this.fourCharacterSheetToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
              this.ThreeCharcterSheet = new System.Windows.Forms.ToolStripMenuItem();
              this.toolStripMenuItem3 = new System.Windows.Forms.ToolStripMenuItem();
              this.oneCharacterSheetToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
              this.loadToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
              this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
              this.saveToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
              this.saveAllToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
              this.saveAsGroupToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
              this.saveToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
              this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
              this.printToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
              this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
              this.helpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
              this.aboutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
              this.printDocument1 = new System.Drawing.Printing.PrintDocument();
              this.LastTabPage = new MyControlLibrary.CharTabPage(this.components);
              this.panel1.SuspendLayout();
              this.userControl11.SuspendLayout();
              this.menuStrip1.SuspendLayout();
              this.SuspendLayout();
              // 
              // contextMenuStrip1
              // 
              this.contextMenuStrip1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
              this.NewTab,
              this.closeAllButThisToolStripMenuItem,
              this.closeTabToolStripMenuItem});
              // 
              // NewTab
              // 
              this.NewTab.Index = 0;
              this.NewTab.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
              this.New4charTab,
              this.New3charTab,
              this.New2charTab,
              this.New1charTab});
              this.NewTab.Text = "New Tab";
              // 
              // New4charTab
              // 
              this.New4charTab.Index = 0;
              this.New4charTab.Text = "4 character sheet";
              this.New4charTab.Click += new System.EventHandler(this.New4charTab_Click);
              // 
              // New3charTab
              // 
              this.New3charTab.Index = 1;
              this.New3charTab.Text = "3 character sheet";
              this.New3charTab.Click += new System.EventHandler(this.New3charTab_Click);
              // 
              // New2charTab
              // 
              this.New2charTab.Index = 2;
              this.New2charTab.Text = "2 character sheet";
              this.New2charTab.Click += new System.EventHandler(this.New2charTab_Click);
              // 
              // New1charTab
              // 
              this.New1charTab.Index = 3;
              this.New1charTab.Text = "1 character sheet";
              this.New1charTab.Click += new System.EventHandler(this.New1charTab_Click);
              // 
              // closeAllButThisToolStripMenuItem
              // 
              this.closeAllButThisToolStripMenuItem.Index = 1;
              this.closeAllButThisToolStripMenuItem.Text = "Close all other tabs";
              this.closeAllButThisToolStripMenuItem.Click += new System.EventHandler(this.closeAllButThisToolStripMenuItem_Click);
              // 
              // closeTabToolStripMenuItem
              // 
              this.closeTabToolStripMenuItem.Index = 2;
              this.closeTabToolStripMenuItem.Text = "Close tab";
              this.closeTabToolStripMenuItem.Click += new System.EventHandler(this.closeTabToolStripMenuItem_Click);
              // 
              // panel1
              // 
              this.panel1.AutoScroll = true;
              this.panel1.AutoSize = true;
              this.panel1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
              this.panel1.Controls.Add(this.userControl11);
              this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
              this.panel1.Location = new System.Drawing.Point(0, 24);
              this.panel1.Name = "panel1";
  
gt:             this.panel1.Size = new System.Drawing.Size(1078, 527);