Click here to Skip to main content
15,881,715 members
Articles / Programming Languages / Visual Basic 10

Having fun with custom collections!

Rate me:
Please Sign up or sign in to vote.
4.91/5 (71 votes)
14 Oct 2011CPOL44 min read 185.8K   2.9K   121  
Creating custom collections from IEnumerable(T) to IDictionary(T) and everything in between!
namespace FunWithCollectionCSharp
{
	partial class frmOrganisedCult
	{
		/// <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();
			this.txtIndexRemove = new System.Windows.Forms.TextBox();
			this.lblIndexRemove = new System.Windows.Forms.Label();
			this.btnReplace = new System.Windows.Forms.Button();
			this.txtIndex = new System.Windows.Forms.TextBox();
			this.lblIndex = new System.Windows.Forms.Label();
			this.lblCount = new System.Windows.Forms.Label();
			this.btnRemove = new System.Windows.Forms.Button();
			this.lblAge = new System.Windows.Forms.Label();
			this.txtAge = new System.Windows.Forms.TextBox();
			this.txtLastName = new System.Windows.Forms.TextBox();
			this.lblLastName = new System.Windows.Forms.Label();
			this.lblFirstName = new System.Windows.Forms.Label();
			this.txtFirstName = new System.Windows.Forms.TextBox();
			this.btnInsert = new System.Windows.Forms.Button();
			this.dgvCult = new System.Windows.Forms.DataGridView();
			this.colMark = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.colRank = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.colFirstName = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.colLastName = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.colAge = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.colFullName = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.errorProvider = new System.Windows.Forms.ErrorProvider(this.components);
			this.bndOrganisedCult = new System.Windows.Forms.BindingSource(this.components);
			this.markDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.rankDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.firstNameDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.lastNameDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.ageDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.fullNameDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			((System.ComponentModel.ISupportInitialize)(this.dgvCult)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.bndOrganisedCult)).BeginInit();
			this.SuspendLayout();
			// 
			// txtIndexRemove
			// 
			this.txtIndexRemove.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
			this.errorProvider.SetIconAlignment(this.txtIndexRemove, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
			this.txtIndexRemove.Location = new System.Drawing.Point(722, 84);
			this.txtIndexRemove.Name = "txtIndexRemove";
			this.txtIndexRemove.Size = new System.Drawing.Size(88, 20);
			this.txtIndexRemove.TabIndex = 26;
			// 
			// lblIndexRemove
			// 
			this.lblIndexRemove.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
			this.lblIndexRemove.AutoSize = true;
			this.lblIndexRemove.Location = new System.Drawing.Point(666, 87);
			this.lblIndexRemove.Name = "lblIndexRemove";
			this.lblIndexRemove.Size = new System.Drawing.Size(36, 13);
			this.lblIndexRemove.TabIndex = 25;
			this.lblIndexRemove.Text = "Inde&x:";
			// 
			// btnReplace
			// 
			this.btnReplace.Location = new System.Drawing.Point(96, 110);
			this.btnReplace.Name = "btnReplace";
			this.btnReplace.Size = new System.Drawing.Size(75, 23);
			this.btnReplace.TabIndex = 24;
			this.btnReplace.Text = "Replace";
			this.btnReplace.UseVisualStyleBackColor = true;
			this.btnReplace.Click += new System.EventHandler(this.btnReplace_Click);
			// 
			// txtIndex
			// 
			this.txtIndex.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
						| System.Windows.Forms.AnchorStyles.Right)));
			this.txtIndex.Location = new System.Drawing.Point(111, 84);
			this.txtIndex.Name = "txtIndex";
			this.txtIndex.Size = new System.Drawing.Size(88, 20);
			this.txtIndex.TabIndex = 22;
			this.txtIndex.Validating += new System.ComponentModel.CancelEventHandler(this.txtIndex_Validating);
			// 
			// lblIndex
			// 
			this.lblIndex.AutoSize = true;
			this.lblIndex.Location = new System.Drawing.Point(12, 87);
			this.lblIndex.Name = "lblIndex";
			this.lblIndex.Size = new System.Drawing.Size(36, 13);
			this.lblIndex.TabIndex = 21;
			this.lblIndex.Text = "&Index:";
			// 
			// lblCount
			// 
			this.lblCount.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
			this.lblCount.AutoSize = true;
			this.lblCount.Location = new System.Drawing.Point(15, 596);
			this.lblCount.Name = "lblCount";
			this.lblCount.Size = new System.Drawing.Size(124, 13);
			this.lblCount.TabIndex = 29;
			this.lblCount.Text = "Number of cult members:";
			// 
			// btnRemove
			// 
			this.btnRemove.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
			this.btnRemove.Location = new System.Drawing.Point(735, 110);
			this.btnRemove.Name = "btnRemove";
			this.btnRemove.Size = new System.Drawing.Size(75, 23);
			this.btnRemove.TabIndex = 27;
			this.btnRemove.Text = "Remove";
			this.btnRemove.UseVisualStyleBackColor = true;
			this.btnRemove.Click += new System.EventHandler(this.btnRemove_Click);
			// 
			// lblAge
			// 
			this.lblAge.AutoSize = true;
			this.lblAge.Location = new System.Drawing.Point(12, 61);
			this.lblAge.Name = "lblAge";
			this.lblAge.Size = new System.Drawing.Size(29, 13);
			this.lblAge.TabIndex = 19;
			this.lblAge.Text = "&Age:";
			// 
			// txtAge
			// 
			this.txtAge.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
						| System.Windows.Forms.AnchorStyles.Right)));
			this.txtAge.Location = new System.Drawing.Point(111, 58);
			this.txtAge.Name = "txtAge";
			this.txtAge.Size = new System.Drawing.Size(356, 20);
			this.txtAge.TabIndex = 20;
			this.txtAge.Validating += new System.ComponentModel.CancelEventHandler(this.txtAge_Validating);
			// 
			// txtLastName
			// 
			this.txtLastName.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
						| System.Windows.Forms.AnchorStyles.Right)));
			this.txtLastName.Location = new System.Drawing.Point(111, 32);
			this.txtLastName.Name = "txtLastName";
			this.txtLastName.Size = new System.Drawing.Size(356, 20);
			this.txtLastName.TabIndex = 18;
			// 
			// lblLastName
			// 
			this.lblLastName.AutoSize = true;
			this.lblLastName.Location = new System.Drawing.Point(12, 35);
			this.lblLastName.Name = "lblLastName";
			this.lblLastName.Size = new System.Drawing.Size(59, 13);
			this.lblLastName.TabIndex = 17;
			this.lblLastName.Text = "&Last name:";
			// 
			// lblFirstName
			// 
			this.lblFirstName.AutoSize = true;
			this.lblFirstName.Location = new System.Drawing.Point(12, 9);
			this.lblFirstName.Name = "lblFirstName";
			this.lblFirstName.Size = new System.Drawing.Size(58, 13);
			this.lblFirstName.TabIndex = 15;
			this.lblFirstName.Text = "&First name:";
			// 
			// txtFirstName
			// 
			this.txtFirstName.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
						| System.Windows.Forms.AnchorStyles.Right)));
			this.txtFirstName.Location = new System.Drawing.Point(111, 6);
			this.txtFirstName.Name = "txtFirstName";
			this.txtFirstName.Size = new System.Drawing.Size(356, 20);
			this.txtFirstName.TabIndex = 16;
			// 
			// btnInsert
			// 
			this.btnInsert.Location = new System.Drawing.Point(15, 110);
			this.btnInsert.Name = "btnInsert";
			this.btnInsert.Size = new System.Drawing.Size(75, 23);
			this.btnInsert.TabIndex = 23;
			this.btnInsert.Text = "Insert";
			this.btnInsert.UseVisualStyleBackColor = true;
			this.btnInsert.Click += new System.EventHandler(this.btnInsert_Click);
			// 
			// dgvCult
			// 
			this.dgvCult.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
						| System.Windows.Forms.AnchorStyles.Left)
						| System.Windows.Forms.AnchorStyles.Right)));
			this.dgvCult.AutoGenerateColumns = false;
			this.dgvCult.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
			this.dgvCult.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
            this.colMark,
            this.colRank,
            this.colFirstName,
            this.colLastName,
            this.colAge,
            this.colFullName,
            this.markDataGridViewTextBoxColumn,
            this.rankDataGridViewTextBoxColumn,
            this.firstNameDataGridViewTextBoxColumn,
            this.lastNameDataGridViewTextBoxColumn,
            this.ageDataGridViewTextBoxColumn,
            this.fullNameDataGridViewTextBoxColumn});
			this.dgvCult.DataSource = this.bndOrganisedCult;
			this.dgvCult.Location = new System.Drawing.Point(15, 139);
			this.dgvCult.Name = "dgvCult";
			this.dgvCult.Size = new System.Drawing.Size(795, 454);
			this.dgvCult.TabIndex = 28;
			// 
			// colMark
			// 
			this.colMark.DataPropertyName = "Mark";
			this.colMark.HeaderText = "Mark";
			this.colMark.Name = "colMark";
			this.colMark.ReadOnly = true;
			this.colMark.Width = 75;
			// 
			// colRank
			// 
			this.colRank.DataPropertyName = "Rank";
			this.colRank.HeaderText = "Rank";
			this.colRank.Name = "colRank";
			this.colRank.ReadOnly = true;
			// 
			// colFirstName
			// 
			this.colFirstName.DataPropertyName = "FirstName";
			this.colFirstName.HeaderText = "First name";
			this.colFirstName.Name = "colFirstName";
			this.colFirstName.ReadOnly = true;
			this.colFirstName.Width = 125;
			// 
			// colLastName
			// 
			this.colLastName.DataPropertyName = "LastName";
			this.colLastName.HeaderText = "Last name";
			this.colLastName.Name = "colLastName";
			this.colLastName.ReadOnly = true;
			this.colLastName.Width = 125;
			// 
			// colAge
			// 
			this.colAge.DataPropertyName = "Age";
			this.colAge.HeaderText = "Age";
			this.colAge.Name = "colAge";
			this.colAge.ReadOnly = true;
			this.colAge.Width = 75;
			// 
			// colFullName
			// 
			this.colFullName.DataPropertyName = "FullName";
			this.colFullName.HeaderText = "Full name";
			this.colFullName.Name = "colFullName";
			this.colFullName.ReadOnly = true;
			this.colFullName.Width = 250;
			// 
			// errorProvider
			// 
			this.errorProvider.ContainerControl = this;
			// 
			// bndOrganisedCult
			// 
			this.bndOrganisedCult.DataSource = typeof(TheCult.OrganisedCult);
			// 
			// markDataGridViewTextBoxColumn
			// 
			this.markDataGridViewTextBoxColumn.DataPropertyName = "Mark";
			this.markDataGridViewTextBoxColumn.HeaderText = "Mark";
			this.markDataGridViewTextBoxColumn.Name = "markDataGridViewTextBoxColumn";
			this.markDataGridViewTextBoxColumn.ReadOnly = true;
			// 
			// rankDataGridViewTextBoxColumn
			// 
			this.rankDataGridViewTextBoxColumn.DataPropertyName = "Rank";
			this.rankDataGridViewTextBoxColumn.HeaderText = "Rank";
			this.rankDataGridViewTextBoxColumn.Name = "rankDataGridViewTextBoxColumn";
			this.rankDataGridViewTextBoxColumn.ReadOnly = true;
			// 
			// firstNameDataGridViewTextBoxColumn
			// 
			this.firstNameDataGridViewTextBoxColumn.DataPropertyName = "FirstName";
			this.firstNameDataGridViewTextBoxColumn.HeaderText = "FirstName";
			this.firstNameDataGridViewTextBoxColumn.Name = "firstNameDataGridViewTextBoxColumn";
			// 
			// lastNameDataGridViewTextBoxColumn
			// 
			this.lastNameDataGridViewTextBoxColumn.DataPropertyName = "LastName";
			this.lastNameDataGridViewTextBoxColumn.HeaderText = "LastName";
			this.lastNameDataGridViewTextBoxColumn.Name = "lastNameDataGridViewTextBoxColumn";
			// 
			// ageDataGridViewTextBoxColumn
			// 
			this.ageDataGridViewTextBoxColumn.DataPropertyName = "Age";
			this.ageDataGridViewTextBoxColumn.HeaderText = "Age";
			this.ageDataGridViewTextBoxColumn.Name = "ageDataGridViewTextBoxColumn";
			// 
			// fullNameDataGridViewTextBoxColumn
			// 
			this.fullNameDataGridViewTextBoxColumn.DataPropertyName = "FullName";
			this.fullNameDataGridViewTextBoxColumn.HeaderText = "FullName";
			this.fullNameDataGridViewTextBoxColumn.Name = "fullNameDataGridViewTextBoxColumn";
			this.fullNameDataGridViewTextBoxColumn.ReadOnly = true;
			// 
			// frmOrganisedCult
			// 
			this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
			this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
			this.ClientSize = new System.Drawing.Size(822, 624);
			this.Controls.Add(this.txtIndexRemove);
			this.Controls.Add(this.lblIndexRemove);
			this.Controls.Add(this.btnReplace);
			this.Controls.Add(this.txtIndex);
			this.Controls.Add(this.lblIndex);
			this.Controls.Add(this.lblCount);
			this.Controls.Add(this.btnRemove);
			this.Controls.Add(this.lblAge);
			this.Controls.Add(this.txtAge);
			this.Controls.Add(this.txtLastName);
			this.Controls.Add(this.lblLastName);
			this.Controls.Add(this.lblFirstName);
			this.Controls.Add(this.txtFirstName);
			this.Controls.Add(this.btnInsert);
			this.Controls.Add(this.dgvCult);
			this.MinimumSize = new System.Drawing.Size(583, 498);
			this.Name = "frmOrganisedCult";
			this.Text = "Organised Cult";
			this.Load += new System.EventHandler(this.frmOrganisedCult_Load);
			((System.ComponentModel.ISupportInitialize)(this.dgvCult)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.bndOrganisedCult)).EndInit();
			this.ResumeLayout(false);
			this.PerformLayout();

		}

		#endregion

		internal System.Windows.Forms.TextBox txtIndexRemove;
		private System.Windows.Forms.ErrorProvider errorProvider;
		internal System.Windows.Forms.Label lblIndexRemove;
		internal System.Windows.Forms.Button btnReplace;
		internal System.Windows.Forms.TextBox txtIndex;
		internal System.Windows.Forms.Label lblIndex;
		internal System.Windows.Forms.Label lblCount;
		internal System.Windows.Forms.Button btnRemove;
		internal System.Windows.Forms.Label lblAge;
		internal System.Windows.Forms.TextBox txtAge;
		internal System.Windows.Forms.TextBox txtLastName;
		internal System.Windows.Forms.Label lblLastName;
		internal System.Windows.Forms.Label lblFirstName;
		internal System.Windows.Forms.TextBox txtFirstName;
		internal System.Windows.Forms.Button btnInsert;
		internal System.Windows.Forms.DataGridView dgvCult;
		internal System.Windows.Forms.DataGridViewTextBoxColumn colMark;
		internal System.Windows.Forms.DataGridViewTextBoxColumn colRank;
		internal System.Windows.Forms.DataGridViewTextBoxColumn colFirstName;
		internal System.Windows.Forms.DataGridViewTextBoxColumn colLastName;
		internal System.Windows.Forms.DataGridViewTextBoxColumn colAge;
		internal System.Windows.Forms.DataGridViewTextBoxColumn colFullName;
		private System.Windows.Forms.BindingSource bndOrganisedCult;
		private System.Windows.Forms.DataGridViewTextBoxColumn markDataGridViewTextBoxColumn;
		private System.Windows.Forms.DataGridViewTextBoxColumn rankDataGridViewTextBoxColumn;
		private System.Windows.Forms.DataGridViewTextBoxColumn firstNameDataGridViewTextBoxColumn;
		private System.Windows.Forms.DataGridViewTextBoxColumn lastNameDataGridViewTextBoxColumn;
		private System.Windows.Forms.DataGridViewTextBoxColumn ageDataGridViewTextBoxColumn;
		private System.Windows.Forms.DataGridViewTextBoxColumn fullNameDataGridViewTextBoxColumn;
	}
}

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, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
CEO JUUN Software
Netherlands Netherlands
Sander Rossel is a Microsoft certified professional developer with experience and expertise in .NET and .NET Core (C#, ASP.NET, and Entity Framework), SQL Server, Azure, Azure DevOps, JavaScript, MongoDB, and other technologies.

He is the owner of JUUN Software, a company specializing in custom software. JUUN Software uses modern, but proven technologies, such as .NET Core, Azure and Azure DevOps.

You can't miss his books on Amazon and his free e-books on Syncfusion!

He wrote a JavaScript LINQ library, arrgh.js (works in IE8+, Edge, Firefox, Chrome, and probably everything else).

Check out his prize-winning articles on CodeProject as well!

Comments and Discussions