Click here to Skip to main content
15,891,423 members
Articles / Programming Languages / Visual Basic

Regions Add-In for VS.NET 2003

Rate me:
Please Sign up or sign in to vote.
4.77/5 (53 votes)
11 Feb 20053 min read 359.7K   4.7K   127  
Create an add-in for VS.NET 2003 to create regions.
//Copyright (c) Microsoft Corporation.  All rights reserved.

using System;
using System.Collections;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Windows.Forms;

namespace RegionsAddIn
{
	/// <summary>
	/// Summary description for Control.
	/// </summary>
	public class Control : System.Windows.Forms.UserControl
	{
		private System.Windows.Forms.ToolBar toolBar1;
		private System.Windows.Forms.TreeView treeView1;
		private System.Windows.Forms.ToolBarButton toolBarButton1;
		/// <summary> 
		/// Required designer variable.
		/// </summary>
		private System.ComponentModel.Container components = null;

		public Control()
		{
			// This call is required by the Windows.Forms Form Designer.
			InitializeComponent();

			// TODO: Add any initialization after the InitForm 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 Component 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.toolBar1 = new System.Windows.Forms.ToolBar();
			this.treeView1 = new System.Windows.Forms.TreeView();
			this.toolBarButton1 = new System.Windows.Forms.ToolBarButton();
			this.SuspendLayout();
			// 
			// toolBar1
			// 
			this.toolBar1.Appearance = System.Windows.Forms.ToolBarAppearance.Flat;
			this.toolBar1.Buttons.AddRange(new System.Windows.Forms.ToolBarButton[] {
																						this.toolBarButton1});
			this.toolBar1.ButtonSize = new System.Drawing.Size(20, 20);
			this.toolBar1.Divider = false;
			this.toolBar1.DropDownArrows = true;
			this.toolBar1.Location = new System.Drawing.Point(0, 0);
			this.toolBar1.Name = "toolBar1";
			this.toolBar1.ShowToolTips = true;
			this.toolBar1.Size = new System.Drawing.Size(232, 26);
			this.toolBar1.TabIndex = 1;
			// 
			// treeView1
			// 
			this.treeView1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
			this.treeView1.Dock = System.Windows.Forms.DockStyle.Fill;
			this.treeView1.ImageIndex = -1;
			this.treeView1.Location = new System.Drawing.Point(0, 26);
			this.treeView1.Name = "treeView1";
			this.treeView1.SelectedImageIndex = -1;
			this.treeView1.Size = new System.Drawing.Size(232, 230);
			this.treeView1.TabIndex = 2;
			// 
			// Control
			// 
			this.Controls.Add(this.treeView1);
			this.Controls.Add(this.toolBar1);
			this.Name = "Control";
			this.Size = new System.Drawing.Size(232, 256);
			this.ResumeLayout(false);

		}
		#endregion

		private void button1_Click(object sender, System.EventArgs e)
		{
			System.Windows.Forms.MessageBox.Show("Hello World!");
		}
	}
}

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
JWT
United Kingdom United Kingdom
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions