Click here to Skip to main content
15,885,546 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 186K   2.9K   121  
Creating custom collections from IEnumerable(T) to IDictionary(T) and everything in between!
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class frmAlphabet
    Inherits System.Windows.Forms.Form

    'Form overrides dispose to clean up the component list.
    <System.Diagnostics.DebuggerNonUserCode()> _
    Protected Overrides Sub Dispose(ByVal disposing As Boolean)
        Try
            If disposing AndAlso components IsNot Nothing Then
                components.Dispose()
            End If
        Finally
            MyBase.Dispose(disposing)
        End Try
    End Sub

    'Required by the Windows Form Designer
    Private components As System.ComponentModel.IContainer

    'NOTE: The following procedure is required by the Windows Form Designer
    'It can be modified using the Windows Form Designer.  
    'Do not modify it using the code editor.
    <System.Diagnostics.DebuggerStepThrough()> _
    Private Sub InitializeComponent()
		Me.components = New System.ComponentModel.Container()
		Me.btnGetAlphabet = New System.Windows.Forms.Button()
		Me.txtAlphabet = New System.Windows.Forms.TextBox()
		Me.btnGetChar = New System.Windows.Forms.Button()
		Me.txtIndex = New System.Windows.Forms.TextBox()
		Me.lblIndex = New System.Windows.Forms.Label()
		Me.txtChar = New System.Windows.Forms.TextBox()
		Me.errorProvider = New System.Windows.Forms.ErrorProvider(Me.components)
		CType(Me.errorProvider, System.ComponentModel.ISupportInitialize).BeginInit()
		Me.SuspendLayout()
		'
		'btnGetAlphabet
		'
		Me.btnGetAlphabet.Location = New System.Drawing.Point(12, 12)
		Me.btnGetAlphabet.Name = "btnGetAlphabet"
		Me.btnGetAlphabet.Size = New System.Drawing.Size(102, 23)
		Me.btnGetAlphabet.TabIndex = 0
		Me.btnGetAlphabet.Text = "Get Alphabet"
		Me.btnGetAlphabet.UseVisualStyleBackColor = True
		'
		'txtAlphabet
		'
		Me.txtAlphabet.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _
					Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
		Me.txtAlphabet.Location = New System.Drawing.Point(12, 41)
		Me.txtAlphabet.Name = "txtAlphabet"
		Me.txtAlphabet.ReadOnly = True
		Me.txtAlphabet.Size = New System.Drawing.Size(350, 20)
		Me.txtAlphabet.TabIndex = 1
		'
		'btnGetChar
		'
		Me.btnGetChar.Location = New System.Drawing.Point(12, 130)
		Me.btnGetChar.Name = "btnGetChar"
		Me.btnGetChar.Size = New System.Drawing.Size(102, 23)
		Me.btnGetChar.TabIndex = 4
		Me.btnGetChar.Text = "Get Character"
		Me.btnGetChar.UseVisualStyleBackColor = True
		'
		'txtIndex
		'
		Me.txtIndex.Location = New System.Drawing.Point(54, 104)
		Me.txtIndex.Name = "txtIndex"
		Me.txtIndex.Size = New System.Drawing.Size(60, 20)
		Me.txtIndex.TabIndex = 3
		'
		'lblIndex
		'
		Me.lblIndex.AutoSize = True
		Me.lblIndex.Location = New System.Drawing.Point(12, 107)
		Me.lblIndex.Name = "lblIndex"
		Me.lblIndex.Size = New System.Drawing.Size(36, 13)
		Me.lblIndex.TabIndex = 2
		Me.lblIndex.Text = "&Index:"
		'
		'txtChar
		'
		Me.txtChar.Location = New System.Drawing.Point(12, 159)
		Me.txtChar.Name = "txtChar"
		Me.txtChar.ReadOnly = True
		Me.txtChar.Size = New System.Drawing.Size(102, 20)
		Me.txtChar.TabIndex = 5
		'
		'errorProvider
		'
		Me.errorProvider.ContainerControl = Me
		'
		'frmAlphabet
		'
		Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
		Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
		Me.ClientSize = New System.Drawing.Size(374, 188)
		Me.Controls.Add(Me.txtChar)
		Me.Controls.Add(Me.lblIndex)
		Me.Controls.Add(Me.txtIndex)
		Me.Controls.Add(Me.btnGetChar)
		Me.Controls.Add(Me.txtAlphabet)
		Me.Controls.Add(Me.btnGetAlphabet)
		Me.MinimumSize = New System.Drawing.Size(390, 226)
		Me.Name = "frmAlphabet"
		Me.Text = "Alphabet"
		CType(Me.errorProvider, System.ComponentModel.ISupportInitialize).EndInit()
		Me.ResumeLayout(False)
		Me.PerformLayout()

	End Sub
	Friend WithEvents btnGetAlphabet As System.Windows.Forms.Button
	Friend WithEvents txtAlphabet As System.Windows.Forms.TextBox
	Friend WithEvents btnGetChar As System.Windows.Forms.Button
	Friend WithEvents txtIndex As System.Windows.Forms.TextBox
	Friend WithEvents lblIndex As System.Windows.Forms.Label
	Friend WithEvents txtChar As System.Windows.Forms.TextBox
	Friend WithEvents errorProvider As System.Windows.Forms.ErrorProvider
End Class

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