Components

A Specialised TextBox for IPv6 Address Entry

This is a C# component, so first of all create an UserControl class called IPV6Address. This most commonly done within a ComponentLibrary project. Pull a GroupBox from the toolbox on to the component design form. We now have the IPV6Address.cs class, a Designer.cs and a resource IPV6Address.resx file. Now just substitute the code with that listed here.

The IPv6 Address Collector

The IPAddress component is a group box called IPv6GroupBox, inside of which we place two more groupbox for the two segments of the IPv6 address. Inside each of these segments we place four NumericalTextBox

    public partial class IPV6Address : UserControl
    {
        public IPV6Address()
        {
            InitializeComponent();
            Byte[] ip_address = new byte[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
            IP = new System.Net.IPAddress(ip_address);
        }

        public Color BackgroundColour
        {
            get
            {
                try { return IPv6GroupBox.BackColor; }
                catch { return Color.AntiqueWhite; }
            }
            set
            {
                try { IPv6GroupBox.BackColor = value; }
                catch { IPv6GroupBox.BackColor = Color.AntiqueWhite; }
            }
        }

        public Color SegmentColour
        {
            get
            {
                try { return SegmentGroup.BackColor; }
                catch { return Color.AntiqueWhite; }
            }
            set
            {
                try { SegmentGroup.BackColor = value; }
                catch { SegmentGroup.BackColor = Color.AntiqueWhite; }
            }
        }

        public Color InterfaceColour
        {
            get
            {
                try { return InterfaceGroup.BackColor; }
                catch { return Color.AntiqueWhite; }
            }
            set
            {
                try { InterfaceGroup.BackColor = value; }
                catch { InterfaceGroup.BackColor = Color.AntiqueWhite; }
            }
        }

        public Color SegmentBoxColour
        {
            get
            {
                try { return SegmentTextBox1.BackColor; }
                catch { return Color.AntiqueWhite; }
            }
            set
            {
                try
                {
                    SegmentTextBox1.BackColor = value;
                    SegmentTextBox2.BackColor = value;
                    SegmentTextBox3.BackColor = value;
                    SegmentTextBox4.BackColor = value;
                }
                catch
                {
                    SegmentTextBox1.BackColor = Color.AntiqueWhite;
                    SegmentTextBox2.BackColor = Color.AntiqueWhite;
                    SegmentTextBox3.BackColor = Color.AntiqueWhite;
                    SegmentTextBox4.BackColor = Color.AntiqueWhite;
                }
            }
        }

        public Color InterfaceBoxColour
        {
            get
            {
                try { return InterfaceTextBox1.BackColor; }
                catch { return Color.AntiqueWhite; }
            }
            set
            {
                try
                {
                    InterfaceTextBox1.BackColor = value;
                    InterfaceTextBox2.BackColor = value;
                    InterfaceTextBox3.BackColor = value;
                    InterfaceTextBox4.BackColor = value;
                }
                catch
                {
                    InterfaceTextBox1.BackColor = Color.AntiqueWhite;
                    InterfaceTextBox2.BackColor = Color.AntiqueWhite;
                    InterfaceTextBox3.BackColor = Color.AntiqueWhite;
                    InterfaceTextBox4.BackColor = Color.AntiqueWhite;
                }
            }
        }

        public Color SegmentTextColour
        {
            get
            {
                try { return SegmentTextBox1.ForeColor; }
                catch { return Color.AntiqueWhite; }
            }
            set
            {
                try
                {
                    SegmentTextBox1.ForeColor = value;
                    SegmentTextBox2.ForeColor = value;
                    SegmentTextBox3.ForeColor = value;
                    SegmentTextBox4.ForeColor = value;
                }
                catch
                {
                    SegmentTextBox1.ForeColor = Color.AntiqueWhite;
                    SegmentTextBox2.ForeColor = Color.AntiqueWhite;
                    SegmentTextBox3.ForeColor = Color.AntiqueWhite;
                    SegmentTextBox4.ForeColor = Color.AntiqueWhite;
                }
            }
        }

        public Color InterfaceTextColour
        {
            get
            {
                try { return InterfaceTextBox1.ForeColor; }
                catch { return Color.AntiqueWhite; }
            }
            set
            {
                try
                {
                    InterfaceTextBox1.ForeColor = value;
                    InterfaceTextBox2.ForeColor = value;
                    InterfaceTextBox3.ForeColor = value;
                    InterfaceTextBox4.ForeColor = value;
                }
                catch
                {
                    InterfaceTextBox1.ForeColor = Color.AntiqueWhite;
                    InterfaceTextBox2.ForeColor = Color.AntiqueWhite;
                    InterfaceTextBox3.ForeColor = Color.AntiqueWhite;
                    InterfaceTextBox4.ForeColor = Color.AntiqueWhite;
                }
            }
        }

        public System.Net.IPAddress IP
        {
            get
            {
                try
                {
                    if (SegmentTextBox1.Text.Length < 1) SegmentTextBox1.IntValue = 0;
                    if (SegmentTextBox2.Text.Length < 1) SegmentTextBox2.IntValue = 0;
                    if (SegmentTextBox3.Text.Length < 1) SegmentTextBox3.IntValue = 0;
                    if (SegmentTextBox4.Text.Length < 1) SegmentTextBox4.IntValue = 0;
                    if (InterfaceTextBox1.Text.Length < 1) InterfaceTextBox1.IntValue = 0;
                    if (InterfaceTextBox2.Text.Length < 1) InterfaceTextBox2.IntValue = 0;
                    if (InterfaceTextBox3.Text.Length < 1) InterfaceTextBox3.IntValue = 0;
                    if (InterfaceTextBox4.Text.Length < 1) InterfaceTextBox4.IntValue = 0;
                    UInt16[] IP_words = new UInt16[8] { Convert.ToUInt16(SegmentTextBox1), Convert.ToUInt16(SegmentTextBox2), Convert.ToUInt16(SegmentTextBox3), Convert.ToUInt16(SegmentTextBox4),
                    Convert.ToUInt16(InterfaceTextBox1), Convert.ToUInt16(InterfaceTextBox2), Convert.ToUInt16(InterfaceTextBox3), Convert.ToUInt16(InterfaceTextBox4) };
                    Byte[] ip_bytes = new Byte[16];
                    for (Int32 i = 0; i < 8; i++)
                    {
                        ip_bytes[(i * 2)] = (Byte)((IP_words[i] & 0xFF00) >> 8);
                        ip_bytes[(i * 2) + 1] = (Byte)(IP_words[i] & 0x00FF);
                    }
                    return new System.Net.IPAddress(ip_bytes);
                }
                catch
                {
                    Byte[] ip_bytes = new Byte[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
                    return new System.Net.IPAddress(ip_bytes);
                }
            }
            set
            {
                Byte[] ip_bytes = value.GetAddressBytes();
                try
                {
                    UInt16[] ip_words = new UInt16[8];
                    for(Int32 i = 0; i < 8; i++)
                    {
                        ip_words[i] = (UInt16)(((UInt16)ip_bytes[(i * 2)] << 8) + (UInt16)ip_bytes[(i * 2) + 1]);
                    }
                    SegmentTextBox1.IntValue = ip_words[0];
                    SegmentTextBox2.IntValue = ip_words[1];
                    SegmentTextBox3.IntValue = ip_words[2];
                    SegmentTextBox4.IntValue = ip_words[3];
                    InterfaceTextBox1.IntValue = ip_words[4];
                    InterfaceTextBox2.IntValue = ip_words[5];
                    InterfaceTextBox3.IntValue = ip_words[6];
                    InterfaceTextBox4.IntValue = ip_words[7];
                }
                catch
                {
                    SegmentTextBox1.IntValue = 0;
                    SegmentTextBox2.IntValue = 0;
                    SegmentTextBox3.IntValue = 0;
                    SegmentTextBox4.IntValue = 0;
                    InterfaceTextBox1.IntValue = 0;
                    InterfaceTextBox2.IntValue = 0;
                    InterfaceTextBox3.IntValue = 0;
                    InterfaceTextBox4.IntValue = 0;
                }
            }
        }

        public UInt16[] Segment_Ip
        {
            get
            {
                try
                {
                    if (SegmentTextBox1.Text.Length < 1) SegmentTextBox1.IntValue = 0;
                    if (SegmentTextBox2.Text.Length < 1) SegmentTextBox2.IntValue = 0;
                    if (SegmentTextBox3.Text.Length < 1) SegmentTextBox3.IntValue = 0;
                    if (SegmentTextBox4.Text.Length < 1) SegmentTextBox4.IntValue = 0;
                    UInt16[] IP_words = new UInt16[4] { Convert.ToUInt16(SegmentTextBox1), Convert.ToUInt16(SegmentTextBox2), Convert.ToUInt16(SegmentTextBox3), Convert.ToUInt16(SegmentTextBox4) };
                    return IP_words;
                }
                catch
                {
                    UInt16[] ip_words = new UInt16[] { 0, 0, 0, 0, 0, 0, 0, 0 };
                    return ip_words;
                }
            }
            set
            {
                try
                {
                    SegmentTextBox1.IntValue = value[0];
                    SegmentTextBox2.IntValue = value[1];
                    SegmentTextBox3.IntValue = value[2];
                    SegmentTextBox4.IntValue = value[3];
                }
                catch
                {
                    SegmentTextBox1.IntValue = 0;
                    SegmentTextBox2.IntValue = 0;
                    SegmentTextBox3.IntValue = 0;
                    SegmentTextBox4.IntValue = 0;
                }
            }
        }

        public UInt16[] Interface_Ip
        {
            get
            {
                try
                {
                    if (InterfaceTextBox1.Text.Length < 1) InterfaceTextBox1.IntValue = 0;
                    if (InterfaceTextBox2.Text.Length < 1) InterfaceTextBox2.IntValue = 0;
                    if (InterfaceTextBox3.Text.Length < 1) InterfaceTextBox3.IntValue = 0;
                    if (InterfaceTextBox4.Text.Length < 1) InterfaceTextBox4.IntValue = 0;
                    UInt16[] IP_words = new UInt16[4] { Convert.ToUInt16(InterfaceTextBox1), Convert.ToUInt16(InterfaceTextBox2), Convert.ToUInt16(InterfaceTextBox3), Convert.ToUInt16(InterfaceTextBox4) };
                    return IP_words;
                }
                catch
                {
                    UInt16[] ip_words = new UInt16[] { 0, 0, 0, 0, 0, 0, 0, 0 };
                    return ip_words;
                }
            }
            set
            {
                try
                {
                    InterfaceTextBox1.IntValue = value[0];
                    InterfaceTextBox2.IntValue = value[1];
                    InterfaceTextBox3.IntValue = value[2];
                    InterfaceTextBox4.IntValue = value[3];
                }
                catch
                {
                    InterfaceTextBox1.IntValue = 0;
                    InterfaceTextBox2.IntValue = 0;
                    InterfaceTextBox3.IntValue = 0;
                    InterfaceTextBox4.IntValue = 0;
                }
            }
        }
    }

Each text box accepts up to 4 hexadecimal digits of entry (0000 to ffff), the entry is 0 padded to a 4 character minimum. Data I/O is with the IPAddress class and a version 6 format assumed. Individualised segment information can be I/O'd as well.

A colouring scheme can be adopted to distinguish the different segments within the overall container.

        private void InitializeComponent()
        {
            this.IPv6GroupBox = new System.Windows.Forms.GroupBox();
            this.InterfaceGroup = new System.Windows.Forms.GroupBox();
            this.InterfaceTextBox4 = new ComponentLibrary.NumericalTextBox();
            this.InterfaceTextBox3 = new ComponentLibrary.NumericalTextBox();
            this.InterfaceTextBox2 = new ComponentLibrary.NumericalTextBox();
            this.InterfaceTextBox1 = new ComponentLibrary.NumericalTextBox();
            this.SegmentGroup = new System.Windows.Forms.GroupBox();
            this.SegmentTextBox4 = new ComponentLibrary.NumericalTextBox();
            this.SegmentTextBox3 = new ComponentLibrary.NumericalTextBox();
            this.SegmentTextBox2 = new ComponentLibrary.NumericalTextBox();
            this.SegmentTextBox1 = new ComponentLibrary.NumericalTextBox();
            this.IPv6GroupBox.SuspendLayout();
            this.InterfaceGroup.SuspendLayout();
            this.SegmentGroup.SuspendLayout();
            this.SuspendLayout();
            // 
            // IPv6GroupBox
            // 
            this.IPv6GroupBox.BackColor = System.Drawing.Color.LightBlue;
            this.IPv6GroupBox.Controls.Add(this.InterfaceGroup);
            this.IPv6GroupBox.Controls.Add(this.SegmentGroup);
            this.IPv6GroupBox.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.IPv6GroupBox.Location = new System.Drawing.Point(4, 4);
                    this.IPv6GroupBox.Margin = new System.Windows.Forms.Padding(0);
                    this.IPv6GroupBox.Name = "IPv6GroupBox";
                    this.IPv6GroupBox.Padding = new System.Windows.Forms.Padding(0);
                    this.IPv6GroupBox.Size = new System.Drawing.Size(308, 64);
                    this.IPv6GroupBox.TabIndex = 0;
                    this.IPv6GroupBox.TabStop = false;
                    this.IPv6GroupBox.Text = "IPv6";
                    // 
                    // InterfaceGroup
                    // 
                    this.InterfaceGroup.BackColor = System.Drawing.Color.LightSkyBlue;
                    this.InterfaceGroup.Controls.Add(this.InterfaceTextBox4);
                    this.InterfaceGroup.Controls.Add(this.InterfaceTextBox3);
                    this.InterfaceGroup.Controls.Add(this.InterfaceTextBox2);
                    this.InterfaceGroup.Controls.Add(this.InterfaceTextBox1);
                    this.InterfaceGroup.Location = new System.Drawing.Point(158, 18);
                    this.InterfaceGroup.Name = "InterfaceGroup";
                    this.InterfaceGroup.Size = new System.Drawing.Size(144, 40);
                    this.InterfaceGroup.TabIndex = 1;
                    this.InterfaceGroup.TabStop = false;
                    this.InterfaceGroup.Text = "interface";
                    // 
                    // InterfaceTextBox4
                    // 
                    this.InterfaceTextBox4.AlignText = System.Windows.Forms.HorizontalAlignment.Center;
                    this.InterfaceTextBox4.AllowBinary = false;
                    this.InterfaceTextBox4.AllowDecimal = false;
                    this.InterfaceTextBox4.AllowHex = true;
                    this.InterfaceTextBox4.AllowNegativeSign = false;
                    this.InterfaceTextBox4.AllowNibble = false;
                    this.InterfaceTextBox4.AllowOctel = false;
                    this.InterfaceTextBox4.AllowPlus = false;
                    this.InterfaceTextBox4.AllowSpace = false;
                    this.InterfaceTextBox4.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
                    this.InterfaceTextBox4.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
                    this.InterfaceTextBox4.IntValue = 65535;
                    this.InterfaceTextBox4.Location = new System.Drawing.Point(108, 18);
                    this.InterfaceTextBox4.MaxDigit = 4;
                    this.InterfaceTextBox4.MaximumIntegerValue = 65535;
                    this.InterfaceTextBox4.MaximumSize = new System.Drawing.Size(30, 20);
                    this.InterfaceTextBox4.MinimumIntegerValue = 0;
                    this.InterfaceTextBox4.MinimumSize = new System.Drawing.Size(30, 20);
                    this.InterfaceTextBox4.Name = "InterfaceTextBox4";
                    this.InterfaceTextBox4.Size = new System.Drawing.Size(30, 20);
                    this.InterfaceTextBox4.SizeTextBox = new System.Drawing.Size(30, 20);
                    this.InterfaceTextBox4.TabIndex = 7;
                    this.InterfaceTextBox4.Text_Background = System.Drawing.Color.LightSteelBlue;
                    this.InterfaceTextBox4.TextPad = true;
                    this.InterfaceTextBox4.TextPadTo = 4;
                    // 
                    // InterfaceTextBox3
                    // 
                    this.InterfaceTextBox3.AlignText = System.Windows.Forms.HorizontalAlignment.Center;
                    this.InterfaceTextBox3.AllowBinary = false;
                    this.InterfaceTextBox3.AllowDecimal = false;
                    this.InterfaceTextBox3.AllowHex = true;
                    this.InterfaceTextBox3.AllowNegativeSign = false;
                    this.InterfaceTextBox3.AllowNibble = false;
                    this.InterfaceTextBox3.AllowOctel = false;
                    this.InterfaceTextBox3.AllowPlus = false;
                    this.InterfaceTextBox3.AllowSpace = false;
                    this.InterfaceTextBox3.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
                    this.InterfaceTextBox3.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
                    this.InterfaceTextBox3.IntValue = 65535;
                    this.InterfaceTextBox3.Location = new System.Drawing.Point(74, 18);
                    this.InterfaceTextBox3.MaxDigit = 4;
                    this.InterfaceTextBox3.MaximumIntegerValue = 65535;
                    this.InterfaceTextBox3.MaximumSize = new System.Drawing.Size(30, 20);
                    this.InterfaceTextBox3.MinimumIntegerValue = 0;
                    this.InterfaceTextBox3.MinimumSize = new System.Drawing.Size(30, 20);
                    this.InterfaceTextBox3.Name = "InterfaceTextBox3";
                    this.InterfaceTextBox3.Size = new System.Drawing.Size(30, 20);
                    this.InterfaceTextBox3.SizeTextBox = new System.Drawing.Size(30, 20);
                    this.InterfaceTextBox3.TabIndex = 6;
                    this.InterfaceTextBox3.Text_Background = System.Drawing.Color.LightSteelBlue;
                    this.InterfaceTextBox3.TextPad = true;
                    this.InterfaceTextBox3.TextPadTo = 4;
                    // 
                    // InterfaceTextBox2
                    // 
                    this.InterfaceTextBox2.AlignText = System.Windows.Forms.HorizontalAlignment.Center;
                    this.InterfaceTextBox2.AllowBinary = false;
                    this.InterfaceTextBox2.AllowDecimal = false;
                    this.InterfaceTextBox2.AllowHex = true;
                    this.InterfaceTextBox2.AllowNegativeSign = false;
                    this.InterfaceTextBox2.AllowNibble = false;
                    this.InterfaceTextBox2.AllowOctel = false;
                    this.InterfaceTextBox2.AllowPlus = false;
                    this.InterfaceTextBox2.AllowSpace = false;
                    this.InterfaceTextBox2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
                    this.InterfaceTextBox2.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
                    this.InterfaceTextBox2.IntValue = 65535;
                    this.InterfaceTextBox2.Location = new System.Drawing.Point(40, 18);
                    this.InterfaceTextBox2.MaxDigit = 4;
                    this.InterfaceTextBox2.MaximumIntegerValue = 65535;
                    this.InterfaceTextBox2.MaximumSize = new System.Drawing.Size(30, 20);
                    this.InterfaceTextBox2.MinimumIntegerValue = 0;
                    this.InterfaceTextBox2.MinimumSize = new System.Drawing.Size(30, 20);
                    this.InterfaceTextBox2.Name = "InterfaceTextBox2";
                    this.InterfaceTextBox2.Size = new System.Drawing.Size(30, 20);
                    this.InterfaceTextBox2.SizeTextBox = new System.Drawing.Size(30, 20);
                    this.InterfaceTextBox2.TabIndex = 5;
                    this.InterfaceTextBox2.Text_Background = System.Drawing.Color.LightSteelBlue;
                    this.InterfaceTextBox2.TextPad = true;
                    this.InterfaceTextBox2.TextPadTo = 4;
                    // 
                    // InterfaceTextBox1
                    // 
                    this.InterfaceTextBox1.AlignText = System.Windows.Forms.HorizontalAlignment.Center;
                    this.InterfaceTextBox1.AllowBinary = false;
                    this.InterfaceTextBox1.AllowDecimal = false;
                    this.InterfaceTextBox1.AllowHex = true;
                    this.InterfaceTextBox1.AllowNegativeSign = false;
                    this.InterfaceTextBox1.AllowNibble = false;
                    this.InterfaceTextBox1.AllowOctel = false;
                    this.InterfaceTextBox1.AllowPlus = false;
                    this.InterfaceTextBox1.AllowSpace = false;
                    this.InterfaceTextBox1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
                    this.InterfaceTextBox1.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
                    this.InterfaceTextBox1.IntValue = 65535;
                    this.InterfaceTextBox1.Location = new System.Drawing.Point(6, 18);
                    this.InterfaceTextBox1.MaxDigit = 4;
                    this.InterfaceTextBox1.MaximumIntegerValue = 65535;
                    this.InterfaceTextBox1.MaximumSize = new System.Drawing.Size(30, 20);
                    this.InterfaceTextBox1.MinimumIntegerValue = 0;
                    this.InterfaceTextBox1.MinimumSize = new System.Drawing.Size(30, 20);
                    this.InterfaceTextBox1.Name = "InterfaceTextBox1";
                    this.InterfaceTextBox1.Size = new System.Drawing.Size(30, 20);
                    this.InterfaceTextBox1.SizeTextBox = new System.Drawing.Size(30, 20);
                    this.InterfaceTextBox1.TabIndex = 4;
                    this.InterfaceTextBox1.Text_Background = System.Drawing.Color.LightSteelBlue;
                    this.InterfaceTextBox1.TextPad = true;
                    this.InterfaceTextBox1.TextPadTo = 4;
                    // 
                    // SegmentGroup
                    // 
                    this.SegmentGroup.BackColor = System.Drawing.Color.LightSkyBlue;
                    this.SegmentGroup.Controls.Add(this.SegmentTextBox4);
                    this.SegmentGroup.Controls.Add(this.SegmentTextBox3);
                    this.SegmentGroup.Controls.Add(this.SegmentTextBox2);
                    this.SegmentGroup.Controls.Add(this.SegmentTextBox1);
                    this.SegmentGroup.Location = new System.Drawing.Point(8, 18);
                    this.SegmentGroup.Name = "SegmentGroup";
                    this.SegmentGroup.Size = new System.Drawing.Size(144, 40);
                    this.SegmentGroup.TabIndex = 0;
                    this.SegmentGroup.TabStop = false;
                    this.SegmentGroup.Text = "segment";
                    // 
                    // SegmentTextBox4
                    // 
                    this.SegmentTextBox4.AlignText = System.Windows.Forms.HorizontalAlignment.Center;
                    this.SegmentTextBox4.AllowBinary = false;
                    this.SegmentTextBox4.AllowDecimal = false;
                    this.SegmentTextBox4.AllowHex = true;
                    this.SegmentTextBox4.AllowNegativeSign = false;
                    this.SegmentTextBox4.AllowNibble = false;
                    this.SegmentTextBox4.AllowOctel = false;
                    this.SegmentTextBox4.AllowPlus = false;
                    this.SegmentTextBox4.AllowSpace = false;
                    this.SegmentTextBox4.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
                    this.SegmentTextBox4.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
                    this.SegmentTextBox4.IntValue = 65535;
                    this.SegmentTextBox4.Location = new System.Drawing.Point(108, 18);
                    this.SegmentTextBox4.MaxDigit = 4;
                    this.SegmentTextBox4.MaximumIntegerValue = 65535;
                    this.SegmentTextBox4.MaximumSize = new System.Drawing.Size(30, 20);
                    this.SegmentTextBox4.MinimumIntegerValue = 0;
                    this.SegmentTextBox4.MinimumSize = new System.Drawing.Size(30, 20);
                    this.SegmentTextBox4.Name = "SegmentTextBox4";
                    this.SegmentTextBox4.Size = new System.Drawing.Size(30, 20);
                    this.SegmentTextBox4.SizeTextBox = new System.Drawing.Size(30, 20);
                    this.SegmentTextBox4.TabIndex = 3;
                    this.SegmentTextBox4.Text_Background = System.Drawing.Color.LightSteelBlue;
                    this.SegmentTextBox4.TextPad = true;
                    this.SegmentTextBox4.TextPadTo = 4;
                    // 
                    // SegmentTextBox3
                    // 
                    this.SegmentTextBox3.AlignText = System.Windows.Forms.HorizontalAlignment.Center;
                    this.SegmentTextBox3.AllowBinary = false;
                    this.SegmentTextBox3.AllowDecimal = false;
                    this.SegmentTextBox3.AllowHex = true;
                    this.SegmentTextBox3.AllowNegativeSign = false;
                    this.SegmentTextBox3.AllowNibble = false;
                    this.SegmentTextBox3.AllowOctel = false;
                    this.SegmentTextBox3.AllowPlus = false;
                    this.SegmentTextBox3.AllowSpace = false;
                    this.SegmentTextBox3.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
                    this.SegmentTextBox3.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
                    this.SegmentTextBox3.IntValue = 65535;
                    this.SegmentTextBox3.Location = new System.Drawing.Point(74, 18);
                    this.SegmentTextBox3.MaxDigit = 4;
                    this.SegmentTextBox3.MaximumIntegerValue = 65535;
                    this.SegmentTextBox3.MaximumSize = new System.Drawing.Size(30, 20);
                    this.SegmentTextBox3.MinimumIntegerValue = 0;
                    this.SegmentTextBox3.MinimumSize = new System.Drawing.Size(30, 20);
                    this.SegmentTextBox3.Name = "SegmentTextBox3";
                    this.SegmentTextBox3.Size = new System.Drawing.Size(30, 20);
                    this.SegmentTextBox3.SizeTextBox = new System.Drawing.Size(30, 20);
                    this.SegmentTextBox3.TabIndex = 2;
                    this.SegmentTextBox3.Text_Background = System.Drawing.Color.LightSteelBlue;
                    this.SegmentTextBox3.TextPad = true;
                    this.SegmentTextBox3.TextPadTo = 4;
                    // 
                    // SegmentTextBox2
                    // 
                    this.SegmentTextBox2.AlignText = System.Windows.Forms.HorizontalAlignment.Center;
                    this.SegmentTextBox2.AllowBinary = false;
                    this.SegmentTextBox2.AllowDecimal = false;
                    this.SegmentTextBox2.AllowHex = true;
                    this.SegmentTextBox2.AllowNegativeSign = false;
                    this.SegmentTextBox2.AllowNibble = false;
                    this.SegmentTextBox2.AllowOctel = false;
                    this.SegmentTextBox2.AllowPlus = false;
                    this.SegmentTextBox2.AllowSpace = false;
                    this.SegmentTextBox2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
                    this.SegmentTextBox2.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
                    this.SegmentTextBox2.IntValue = 65535;
                    this.SegmentTextBox2.Location = new System.Drawing.Point(40, 18);
                    this.SegmentTextBox2.MaxDigit = 4;
                    this.SegmentTextBox2.MaximumIntegerValue = 65535;
                    this.SegmentTextBox2.MaximumSize = new System.Drawing.Size(30, 20);
                    this.SegmentTextBox2.MinimumIntegerValue = 0;
                    this.SegmentTextBox2.MinimumSize = new System.Drawing.Size(30, 20);
                    this.SegmentTextBox2.Name = "SegmentTextBox2";
                    this.SegmentTextBox2.Size = new System.Drawing.Size(30, 20);
                    this.SegmentTextBox2.SizeTextBox = new System.Drawing.Size(30, 20);
                    this.SegmentTextBox2.TabIndex = 1;
                    this.SegmentTextBox2.Text_Background = System.Drawing.Color.LightSteelBlue;
                    this.SegmentTextBox2.TextPad = true;
                    this.SegmentTextBox2.TextPadTo = 4;
                    // 
                    // SegmentTextBox1
                    // 
                    this.SegmentTextBox1.AlignText = System.Windows.Forms.HorizontalAlignment.Center;
                    this.SegmentTextBox1.AllowBinary = false;
                    this.SegmentTextBox1.AllowDecimal = false;
                    this.SegmentTextBox1.AllowHex = true;
                    this.SegmentTextBox1.AllowNegativeSign = false;
                    this.SegmentTextBox1.AllowNibble = false;
                    this.SegmentTextBox1.AllowOctel = false;
                    this.SegmentTextBox1.AllowPlus = false;
                    this.SegmentTextBox1.AllowSpace = false;
                    this.SegmentTextBox1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
                    this.SegmentTextBox1.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
                    this.SegmentTextBox1.IntValue = 65535;
                    this.SegmentTextBox1.Location = new System.Drawing.Point(6, 18);
                    this.SegmentTextBox1.MaxDigit = 4;
                    this.SegmentTextBox1.MaximumIntegerValue = 65535;
                    this.SegmentTextBox1.MaximumSize = new System.Drawing.Size(30, 20);
                    this.SegmentTextBox1.MinimumIntegerValue = 0;
                    this.SegmentTextBox1.MinimumSize = new System.Drawing.Size(30, 20);
                    this.SegmentTextBox1.Name = "SegmentTextBox1";
                    this.SegmentTextBox1.Size = new System.Drawing.Size(30, 20);
                    this.SegmentTextBox1.SizeTextBox = new System.Drawing.Size(30, 20);
                    this.SegmentTextBox1.TabIndex = 0;
                    this.SegmentTextBox1.Text_Background = System.Drawing.Color.LightSteelBlue;
                    this.SegmentTextBox1.TextPad = true;
                    this.SegmentTextBox1.TextPadTo = 4;
                    // 
                    // IPV6Address
                    // 
                    this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
                    this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
                    this.Controls.Add(this.IPv6GroupBox);
                    this.Name = "IPV6Address";
                    this.Size = new System.Drawing.Size(310, 72);
                    this.IPv6GroupBox.ResumeLayout(false);
                    this.InterfaceGroup.ResumeLayout(false);
                    this.SegmentGroup.ResumeLayout(false);
                    this.ResumeLayout(false);

                }

        private System.Windows.Forms.GroupBox IPv6GroupBox;
        private System.Windows.Forms.GroupBox InterfaceGroup;
        private System.Windows.Forms.GroupBox SegmentGroup;
        private NumericalTextBox InterfaceTextBox1;
        private NumericalTextBox SegmentTextBox4;
        private NumericalTextBox SegmentTextBox3;
        private NumericalTextBox SegmentTextBox2;
        private NumericalTextBox SegmentTextBox1;
        private NumericalTextBox InterfaceTextBox2;
        private NumericalTextBox InterfaceTextBox4;
        private NumericalTextBox InterfaceTextBox3;
    }

The designer can be copied or the equivalent generated by hand by changing the properties of the designer form. The properties must coincide with that required by the .cs code. Note: only InitializeComponent() and declarations are here, the rest of the designer does not change!