Click here to Skip to main content
15,893,904 members
Articles / Programming Languages / C#

IPToolbox: A VS2005-like Toolbox

Rate me:
Please Sign up or sign in to vote.
4.90/5 (50 votes)
25 May 20074 min read 232.9K   7K   162  
A Visual Studio 2005-like ToolBox control which supports almost all features of the original: drag'n'drop, renaming, hiding tabs, items, and disabling items
using System.ComponentModel;
using System.ComponentModel.Design;
using System.Windows.Forms;

namespace TestToolbox
{
    partial class Form1
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (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();
            IP.Components.Toolbox.Tab tab7 = new IP.Components.Toolbox.Tab();
            IP.Components.Toolbox.Item item2 = new IP.Components.Toolbox.Item();
            IP.Components.Toolbox.Tab tab8 = new IP.Components.Toolbox.Tab();
            IP.Components.Toolbox.Tab tab9 = new IP.Components.Toolbox.Tab();
            IP.Components.Toolbox.Tab tab10 = new IP.Components.Toolbox.Tab();
            IP.Components.Toolbox.Tab tab11 = new IP.Components.Toolbox.Tab();
            IP.Components.Toolbox.Tab tab12 = new IP.Components.Toolbox.Tab();
            this.splitContainer1 = new System.Windows.Forms.SplitContainer();
            this.splitContainer2 = new System.Windows.Forms.SplitContainer();
            this.toolbox1 = new TestToolbox.Form1.DemoToolbox();
            this.statusStrip1 = new System.Windows.Forms.StatusStrip();
            this.toolStripStatusLabel1 = new System.Windows.Forms.ToolStripStatusLabel();
            this._itemLabel = new System.Windows.Forms.ToolStripStatusLabel();
            this.propertyGrid1 = new System.Windows.Forms.PropertyGrid();
            this.menuStrip1 = new System.Windows.Forms.MenuStrip();
            this.toolboxToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
            this.disableAllToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
            this.hideTabsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
            this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripSeparator();
            this.saveToToolboxxmlToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
            this.loadFromToolboxxmlToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
            this.splitContainer1.Panel1.SuspendLayout();
            this.splitContainer1.SuspendLayout();
            this.splitContainer2.Panel1.SuspendLayout();
            this.splitContainer2.Panel2.SuspendLayout();
            this.splitContainer2.SuspendLayout();
            this.statusStrip1.SuspendLayout();
            this.menuStrip1.SuspendLayout();
            this.SuspendLayout();
            // 
            // splitContainer1
            // 
            this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
            this.splitContainer1.Location = new System.Drawing.Point(0, 24);
            this.splitContainer1.Name = "splitContainer1";
            // 
            // splitContainer1.Panel1
            // 
            this.splitContainer1.Panel1.Controls.Add(this.splitContainer2);
            // 
            // splitContainer1.Panel2
            // 
            this.splitContainer1.Panel2.BackColor = System.Drawing.SystemColors.ButtonHighlight;
            this.splitContainer1.Size = new System.Drawing.Size(695, 571);
            this.splitContainer1.SplitterDistance = 200;
            this.splitContainer1.TabIndex = 6;
            // 
            // splitContainer2
            // 
            this.splitContainer2.Dock = System.Windows.Forms.DockStyle.Fill;
            this.splitContainer2.Location = new System.Drawing.Point(0, 0);
            this.splitContainer2.Name = "splitContainer2";
            this.splitContainer2.Orientation = System.Windows.Forms.Orientation.Horizontal;
            // 
            // splitContainer2.Panel1
            // 
            this.splitContainer2.Panel1.Controls.Add(this.toolbox1);
            this.splitContainer2.Panel1.Controls.Add(this.statusStrip1);
            // 
            // splitContainer2.Panel2
            // 
            this.splitContainer2.Panel2.Controls.Add(this.propertyGrid1);
            this.splitContainer2.Size = new System.Drawing.Size(200, 571);
            this.splitContainer2.SplitterDistance = 302;
            this.splitContainer2.TabIndex = 7;
            // 
            // toolbox1
            // 
            this.toolbox1.AllowDrop = true;
            this.toolbox1.BackColorGradientEnd = System.Drawing.Color.AliceBlue;
            this.toolbox1.BackColorGradientStart = System.Drawing.Color.PaleGoldenrod;
            item2.Image = global::TestToolbox.Properties.Resources.TimeStart;
            item2.Tag = null;
            item2.Text = "Mail";
            item2.Tooltip = "Mail";
            item2.TransparentColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(253)))), ((int)(((byte)(255)))));
            tab7.Items.AddRange(new IP.Components.Toolbox.Item[] {
            item2});
            tab7.Opened = true;
            tab7.Tag = null;
            tab7.Text = "Components";
            tab11.Opened = true;
            tab11.Tag = null;
            tab11.Text = "Category";
            tab10.Categories.AddRange(new IP.Components.Toolbox.Tab[] {
            tab11});
            tab10.Opened = true;
            tab10.Tag = null;
            tab10.Text = "Category";
            tab9.Categories.AddRange(new IP.Components.Toolbox.Tab[] {
            tab10});
            tab9.Opened = true;
            tab9.Tag = null;
            tab9.Text = "Category";
            tab12.Opened = true;
            tab12.Tag = null;
            tab12.Text = "Category1";
            tab8.Categories.AddRange(new IP.Components.Toolbox.Tab[] {
            tab9,
            tab12});
            tab8.Opened = true;
            tab8.Tag = null;
            tab8.Text = "Test Nested";
            this.toolbox1.Categories.AddRange(new IP.Components.Toolbox.Tab[] {
            tab7,
            tab8});
            this.toolbox1.Dock = System.Windows.Forms.DockStyle.Fill;
            this.toolbox1.Location = new System.Drawing.Point(0, 0);
            this.toolbox1.Name = "toolbox1";
            this.toolbox1.SelectedCategory = "";
            this.toolbox1.ShowPointer = false;
            this.toolbox1.Size = new System.Drawing.Size(200, 280);
            this.toolbox1.TabColorStyle = IP.Components.Toolbox.ColorStyle.Darker;
            this.toolbox1.TabIndex = 7;
            this.toolbox1.Text = "toolbox1";
            this.toolbox1.DoubleClick += new System.EventHandler(this.OnToolboxDoubleClick);
            this.toolbox1.SelectItem += new System.EventHandler<IP.Components.ItemSelectionEventArgs>(this.OnItemSelected);
            // 
            // statusStrip1
            // 
            this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this.toolStripStatusLabel1,
            this._itemLabel});
            this.statusStrip1.Location = new System.Drawing.Point(0, 280);
            this.statusStrip1.Name = "statusStrip1";
            this.statusStrip1.Size = new System.Drawing.Size(200, 22);
            this.statusStrip1.TabIndex = 8;
            this.statusStrip1.Text = "statusStrip1";
            // 
            // toolStripStatusLabel1
            // 
            this.toolStripStatusLabel1.Name = "toolStripStatusLabel1";
            this.toolStripStatusLabel1.Size = new System.Drawing.Size(52, 17);
            this.toolStripStatusLabel1.Text = "Selected:";
            // 
            // _itemLabel
            // 
            this._itemLabel.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold);
            this._itemLabel.Name = "_itemLabel";
            this._itemLabel.Size = new System.Drawing.Size(45, 17);
            this._itemLabel.Text = "[None]";
            // 
            // propertyGrid1
            // 
            this.propertyGrid1.Dock = System.Windows.Forms.DockStyle.Fill;
            this.propertyGrid1.Location = new System.Drawing.Point(0, 0);
            this.propertyGrid1.Name = "propertyGrid1";
            this.propertyGrid1.SelectedObject = this.toolbox1;
            this.propertyGrid1.Size = new System.Drawing.Size(200, 265);
            this.propertyGrid1.TabIndex = 0;
            // 
            // menuStrip1
            // 
            this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this.toolboxToolStripMenuItem});
            this.menuStrip1.Location = new System.Drawing.Point(0, 0);
            this.menuStrip1.Name = "menuStrip1";
            this.menuStrip1.Size = new System.Drawing.Size(695, 24);
            this.menuStrip1.TabIndex = 7;
            this.menuStrip1.Text = "menuStrip1";
            // 
            // toolboxToolStripMenuItem
            // 
            this.toolboxToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this.disableAllToolStripMenuItem,
            this.hideTabsToolStripMenuItem,
            this.toolStripMenuItem1,
            this.saveToToolboxxmlToolStripMenuItem,
            this.loadFromToolboxxmlToolStripMenuItem});
            this.toolboxToolStripMenuItem.Name = "toolboxToolStripMenuItem";
            this.toolboxToolStripMenuItem.Size = new System.Drawing.Size(57, 20);
            this.toolboxToolStripMenuItem.Text = "Toolbox";
            // 
            // disableAllToolStripMenuItem
            // 
            this.disableAllToolStripMenuItem.Name = "disableAllToolStripMenuItem";
            this.disableAllToolStripMenuItem.Size = new System.Drawing.Size(192, 22);
            this.disableAllToolStripMenuItem.Text = "Disable All";
            this.disableAllToolStripMenuItem.Click += new System.EventHandler(this.disableAllToolStripMenuItem_Click);
            // 
            // hideTabsToolStripMenuItem
            // 
            this.hideTabsToolStripMenuItem.Name = "hideTabsToolStripMenuItem";
            this.hideTabsToolStripMenuItem.Size = new System.Drawing.Size(192, 22);
            this.hideTabsToolStripMenuItem.Text = "Hide Tabs";
            this.hideTabsToolStripMenuItem.Click += new System.EventHandler(this.hideTabsToolStripMenuItem_Click);
            // 
            // toolStripMenuItem1
            // 
            this.toolStripMenuItem1.Name = "toolStripMenuItem1";
            this.toolStripMenuItem1.Size = new System.Drawing.Size(189, 6);
            // 
            // saveToToolboxxmlToolStripMenuItem
            // 
            this.saveToToolboxxmlToolStripMenuItem.Name = "saveToToolboxxmlToolStripMenuItem";
            this.saveToToolboxxmlToolStripMenuItem.Size = new System.Drawing.Size(192, 22);
            this.saveToToolboxxmlToolStripMenuItem.Text = "Save to toolbox.xml";
            this.saveToToolboxxmlToolStripMenuItem.Click += new System.EventHandler(this.OnSaveToolbox);
            // 
            // loadFromToolboxxmlToolStripMenuItem
            // 
            this.loadFromToolboxxmlToolStripMenuItem.Name = "loadFromToolboxxmlToolStripMenuItem";
            this.loadFromToolboxxmlToolStripMenuItem.Size = new System.Drawing.Size(192, 22);
            this.loadFromToolboxxmlToolStripMenuItem.Text = "Load from toolbox.xml";
            this.loadFromToolboxxmlToolStripMenuItem.Click += new System.EventHandler(this.OnLoadToolbox);
            // 
            // Form1
            // 
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(695, 595);
            this.Controls.Add(this.splitContainer1);
            this.Controls.Add(this.menuStrip1);
            this.MainMenuStrip = this.menuStrip1;
            this.Name = "Form1";
            this.Text = "Form1";
            this.splitContainer1.Panel1.ResumeLayout(false);
            this.splitContainer1.ResumeLayout(false);
            this.splitContainer2.Panel1.ResumeLayout(false);
            this.splitContainer2.Panel1.PerformLayout();
            this.splitContainer2.Panel2.ResumeLayout(false);
            this.splitContainer2.ResumeLayout(false);
            this.statusStrip1.ResumeLayout(false);
            this.statusStrip1.PerformLayout();
            this.menuStrip1.ResumeLayout(false);
            this.menuStrip1.PerformLayout();
            this.ResumeLayout(false);
            this.PerformLayout();

        }

        #endregion

        private System.Windows.Forms.SplitContainer splitContainer1;

        private DesignSurface _surface = null;
        private Control _view = null;
        private IDesignerHost _host = null;
        private MenuStrip menuStrip1;
        private ToolStripMenuItem toolboxToolStripMenuItem;
        private ToolStripMenuItem disableAllToolStripMenuItem;
        private ToolStripMenuItem hideTabsToolStripMenuItem;
        private SplitContainer splitContainer2;
        private Form1.DemoToolbox toolbox1;
        private PropertyGrid propertyGrid1;
        private StatusStrip statusStrip1;
        private ToolStripStatusLabel toolStripStatusLabel1;
        private ToolStripStatusLabel _itemLabel;
        private ToolStripSeparator toolStripMenuItem1;
        private ToolStripMenuItem saveToToolboxxmlToolStripMenuItem;
        private ToolStripMenuItem loadFromToolboxxmlToolStripMenuItem;
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
I@n
Web Developer
Ukraine Ukraine
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions