Click here to Skip to main content
15,885,278 members
Articles / Programming Languages / C#

WCF / WPF Chat Application

Rate me:
Please Sign up or sign in to vote.
4.93/5 (478 votes)
22 Jul 2011CPOL29 min read 1.9M   61.3K   1.2K  
How to create a peer-to-peer chat application using Windows Communication Foundation
namespace VainWebSpider
{
    #region frmLoader CLASS
    /// <summary>
    /// Provides the gui components and their setup for the
    /// frmLoader form
    /// </summary>
    partial class frmLoader
    {
        #region Instance Fields
        //instance fields
        private System.ComponentModel.IContainer components = null;
        private System.Windows.Forms.Panel pnlFillMain;
        private System.Windows.Forms.Panel pnlMainCentre;
        private System.Windows.Forms.PictureBox picTopBanner;
        private System.Windows.Forms.Panel pnlUser;
        private System.Windows.Forms.LinkLabel lnkChangeUser;
        private System.Windows.Forms.Label lblCurrentUser;
        private System.Windows.Forms.PictureBox picArrow;
        private System.Windows.Forms.PictureBox picUser;
        private System.Windows.Forms.LinkLabel lnkLoadMainForm;
        private System.Windows.Forms.PictureBox picArrow2;
        private System.Windows.Forms.PictureBox picSquares;
        #endregion
        #region Dispose
        /// <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);
        }
        #endregion
        #region designer
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmLoader));
            this.pnlFillMain = new System.Windows.Forms.Panel();
            this.pnlMainCentre = new System.Windows.Forms.Panel();
            this.pnlUser = new System.Windows.Forms.Panel();
            this.lnkLoadMainForm = new System.Windows.Forms.LinkLabel();
            this.lnkChangeUser = new System.Windows.Forms.LinkLabel();
            this.lblCurrentUser = new System.Windows.Forms.Label();
            this.picSquares = new System.Windows.Forms.PictureBox();
            this.picArrow2 = new System.Windows.Forms.PictureBox();
            this.picArrow = new System.Windows.Forms.PictureBox();
            this.picUser = new System.Windows.Forms.PictureBox();
            this.picTopBanner = new System.Windows.Forms.PictureBox();
            this.pnlFillMain.SuspendLayout();
            this.pnlMainCentre.SuspendLayout();
            this.pnlUser.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.picSquares)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.picArrow2)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.picArrow)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.picUser)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.picTopBanner)).BeginInit();
            this.SuspendLayout();
            // 
            // pnlFillMain
            // 
            this.pnlFillMain.Controls.Add(this.pnlMainCentre);
            this.pnlFillMain.Controls.Add(this.picTopBanner);
            this.pnlFillMain.Dock = System.Windows.Forms.DockStyle.Fill;
            this.pnlFillMain.Location = new System.Drawing.Point(0, 0);
            this.pnlFillMain.Margin = new System.Windows.Forms.Padding(0);
            this.pnlFillMain.Name = "pnlFillMain";
            this.pnlFillMain.Size = new System.Drawing.Size(778, 488);
            this.pnlFillMain.TabIndex = 8;
            // 
            // pnlMainCentre
            // 
            this.pnlMainCentre.Controls.Add(this.pnlUser);
            this.pnlMainCentre.Dock = System.Windows.Forms.DockStyle.Fill;
            this.pnlMainCentre.Location = new System.Drawing.Point(0, 100);
            this.pnlMainCentre.Margin = new System.Windows.Forms.Padding(0);
            this.pnlMainCentre.Name = "pnlMainCentre";
            this.pnlMainCentre.Size = new System.Drawing.Size(778, 388);
            this.pnlMainCentre.TabIndex = 9;
            // 
            // pnlUser
            // 
            this.pnlUser.Controls.Add(this.picSquares);
            this.pnlUser.Controls.Add(this.picArrow2);
            this.pnlUser.Controls.Add(this.lnkLoadMainForm);
            this.pnlUser.Controls.Add(this.lnkChangeUser);
            this.pnlUser.Controls.Add(this.lblCurrentUser);
            this.pnlUser.Controls.Add(this.picArrow);
            this.pnlUser.Controls.Add(this.picUser);
            this.pnlUser.Dock = System.Windows.Forms.DockStyle.Fill;
            this.pnlUser.Location = new System.Drawing.Point(0, 0);
            this.pnlUser.Name = "pnlUser";
            this.pnlUser.Size = new System.Drawing.Size(778, 388);
            this.pnlUser.TabIndex = 12;
            // 
            // lnkLoadMainForm
            // 
            this.lnkLoadMainForm.ActiveLinkColor = System.Drawing.Color.LightBlue;
            this.lnkLoadMainForm.AutoSize = true;
            this.lnkLoadMainForm.LinkColor = System.Drawing.Color.RoyalBlue;
            this.lnkLoadMainForm.Location = new System.Drawing.Point(116, 102);
            this.lnkLoadMainForm.Name = "lnkLoadMainForm";
            this.lnkLoadMainForm.Size = new System.Drawing.Size(128, 13);
            this.lnkLoadMainForm.TabIndex = 17;
            this.lnkLoadMainForm.TabStop = true;
            this.lnkLoadMainForm.Text = "Proceed to main interface";
            this.lnkLoadMainForm.VisitedLinkColor = System.Drawing.Color.RoyalBlue;
            this.lnkLoadMainForm.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.lnkLoadMainForm_LinkClicked);
            // 
            // lnkChangeUser
            // 
            this.lnkChangeUser.ActiveLinkColor = System.Drawing.Color.LightBlue;
            this.lnkChangeUser.AutoSize = true;
            this.lnkChangeUser.LinkColor = System.Drawing.Color.RoyalBlue;
            this.lnkChangeUser.Location = new System.Drawing.Point(116, 44);
            this.lnkChangeUser.Name = "lnkChangeUser";
            this.lnkChangeUser.Size = new System.Drawing.Size(110, 13);
            this.lnkChangeUser.TabIndex = 15;
            this.lnkChangeUser.TabStop = true;
            this.lnkChangeUser.Text = "Select a different user";
            this.lnkChangeUser.VisitedLinkColor = System.Drawing.Color.RoyalBlue;
            this.lnkChangeUser.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.lnkChangeUser_LinkClicked);
            // 
            // lblCurrentUser
            // 
            this.lblCurrentUser.AutoSize = true;
            this.lblCurrentUser.Font = new System.Drawing.Font("Arial Black", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.lblCurrentUser.ForeColor = System.Drawing.Color.SteelBlue;
            this.lblCurrentUser.Location = new System.Drawing.Point(82, 8);
            this.lblCurrentUser.Name = "lblCurrentUser";
            this.lblCurrentUser.Size = new System.Drawing.Size(167, 27);
            this.lblCurrentUser.TabIndex = 14;
            this.lblCurrentUser.Text = "AUTHOR TEXT";
            // 
            // picSquares
            // 
            this.picSquares.Image = global::VaneWebSpider.FormResources.Squares;
            this.picSquares.Location = new System.Drawing.Point(381, 185);
            this.picSquares.Name = "picSquares";
            this.picSquares.Size = new System.Drawing.Size(400, 200);
            this.picSquares.TabIndex = 19;
            this.picSquares.TabStop = false;
            // 
            // picArrow2
            // 
            this.picArrow2.Image = global::VaneWebSpider.FormResources.arrow;
            this.picArrow2.Location = new System.Drawing.Point(83, 98);
            this.picArrow2.Name = "picArrow2";
            this.picArrow2.Size = new System.Drawing.Size(20, 22);
            this.picArrow2.TabIndex = 18;
            this.picArrow2.TabStop = false;
            // 
            // picArrow
            // 
            this.picArrow.Image = global::VaneWebSpider.FormResources.arrow;
            this.picArrow.Location = new System.Drawing.Point(83, 38);
            this.picArrow.Name = "picArrow";
            this.picArrow.Size = new System.Drawing.Size(20, 22);
            this.picArrow.TabIndex = 13;
            this.picArrow.TabStop = false;
            // 
            // picUser
            // 
            this.picUser.Image = global::VaneWebSpider.FormResources.Person;
            this.picUser.Location = new System.Drawing.Point(18, 9);
            this.picUser.Name = "picUser";
            this.picUser.Size = new System.Drawing.Size(59, 55);
            this.picUser.TabIndex = 0;
            this.picUser.TabStop = false;
            // 
            // picTopBanner
            // 
            this.picTopBanner.Dock = System.Windows.Forms.DockStyle.Top;
            this.picTopBanner.Image = global::VaneWebSpider.FormResources.TopBanner;
            this.picTopBanner.Location = new System.Drawing.Point(0, 0);
            this.picTopBanner.Margin = new System.Windows.Forms.Padding(0);
            this.picTopBanner.Name = "picTopBanner";
            this.picTopBanner.Size = new System.Drawing.Size(778, 100);
            this.picTopBanner.TabIndex = 8;
            this.picTopBanner.TabStop = false;
            // 
            // frmLoader
            // 
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.BackColor = System.Drawing.Color.White;
            this.ClientSize = new System.Drawing.Size(778, 488);
            this.Controls.Add(this.pnlFillMain);
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
            this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
            this.ImeMode = System.Windows.Forms.ImeMode.Off;
            this.MaximizeBox = false;
            this.MaximumSize = new System.Drawing.Size(784, 520);
            this.MinimizeBox = false;
            this.MinimumSize = new System.Drawing.Size(784, 520);
            this.Name = "frmLoader";
            this.ShowInTaskbar = false;
            this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
            this.Text = "Vain Web Spider";
            this.Load += new System.EventHandler(this.frmLoader_Load);
            this.pnlFillMain.ResumeLayout(false);
            this.pnlMainCentre.ResumeLayout(false);
            this.pnlUser.ResumeLayout(false);
            this.pnlUser.PerformLayout();
            ((System.ComponentModel.ISupportInitialize)(this.picSquares)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.picArrow2)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.picArrow)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.picUser)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.picTopBanner)).EndInit();
            this.ResumeLayout(false);

        }

        #endregion
    }
    #endregion
}

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
Software Developer (Senior)
United Kingdom United Kingdom
I currently hold the following qualifications (amongst others, I also studied Music Technology and Electronics, for my sins)

- MSc (Passed with distinctions), in Information Technology for E-Commerce
- BSc Hons (1st class) in Computer Science & Artificial Intelligence

Both of these at Sussex University UK.

Award(s)

I am lucky enough to have won a few awards for Zany Crazy code articles over the years

  • Microsoft C# MVP 2016
  • Codeproject MVP 2016
  • Microsoft C# MVP 2015
  • Codeproject MVP 2015
  • Microsoft C# MVP 2014
  • Codeproject MVP 2014
  • Microsoft C# MVP 2013
  • Codeproject MVP 2013
  • Microsoft C# MVP 2012
  • Codeproject MVP 2012
  • Microsoft C# MVP 2011
  • Codeproject MVP 2011
  • Microsoft C# MVP 2010
  • Codeproject MVP 2010
  • Microsoft C# MVP 2009
  • Codeproject MVP 2009
  • Microsoft C# MVP 2008
  • Codeproject MVP 2008
  • And numerous codeproject awards which you can see over at my blog

Comments and Discussions