Click here to Skip to main content
15,878,748 members
Articles / Desktop Programming / Win32

Introduction to C# and Fuzzy Logic

Rate me:
Please Sign up or sign in to vote.
3.00/5 (18 votes)
2 Feb 2008CPOL3 min read 146.1K   5.3K   40  
This article gives a brief introduction to the basic technology of rule based fuzzy logic systems using a container crane control example
��using System;

using System.Drawing;

using System.Collections;

using System.ComponentModel;

using System.Windows.Forms;



namespace WindowsApplication3

{

	public class Form2 : System.Windows.Forms.Form

	{

		private System.Windows.Forms.Label label3;

		private System.Windows.Forms.Label label4;

		private System.Windows.Forms.Label label8;

		private System.Windows.Forms.Label label7;

		private System.Windows.Forms.Button button1;

		private System.Windows.Forms.Label label2;

		/// <summary>

		/// Required designer variable.

		/// </summary>

		private System.ComponentModel.Container components = null;



		public Form2()

		{

			InitializeComponent();



		}



		protected override void Dispose( bool disposing )

		{

			if( disposing )

			{

				if(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.label3 = new System.Windows.Forms.Label();

			this.label4 = new System.Windows.Forms.Label();

			this.label8 = new System.Windows.Forms.Label();

			this.label7 = new System.Windows.Forms.Label();

			this.button1 = new System.Windows.Forms.Button();

			this.label2 = new System.Windows.Forms.Label();

			this.SuspendLayout();

			// 

			// label3

			// 

			this.label3.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));

			this.label3.ImeMode = System.Windows.Forms.ImeMode.NoControl;

			this.label3.Location = new System.Drawing.Point(16, 16);

			this.label3.Name = "label3";

			this.label3.Size = new System.Drawing.Size(208, 23);

			this.label3.TabIndex = 6;

			this.label3.Text = "Crane Simulator and Controller";

			this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;

			// 

			// label4

			// 

			this.label4.ImeMode = System.Windows.Forms.ImeMode.NoControl;

			this.label4.Location = new System.Drawing.Point(240, 8);

			this.label4.Name = "label4";

			this.label4.Size = new System.Drawing.Size(32, 32);

			this.label4.TabIndex = 7;

			this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;

			// 

			// label8

			// 

			this.label8.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));

			this.label8.ImeMode = System.Windows.Forms.ImeMode.NoControl;

			this.label8.Location = new System.Drawing.Point(16, 48);

			this.label8.Name = "label8";

			this.label8.Size = new System.Drawing.Size(264, 23);

			this.label8.TabIndex = 9;

			this.label8.Text = "Programmer : Amir Hossein Kelary Rad";

			this.label8.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;

			// 

			// label7

			// 

			this.label7.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));

			this.label7.ImeMode = System.Windows.Forms.ImeMode.NoControl;

			this.label7.Location = new System.Drawing.Point(16, 80);

			this.label7.Name = "label7";

			this.label7.Size = new System.Drawing.Size(232, 23);

			this.label7.TabIndex = 14;

			this.label7.Text = "Email : kelari_amir@operamail.com";

			this.label7.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;

			// 

			// button1

			// 

			this.button1.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));

			this.button1.Location = new System.Drawing.Point(224, 144);

			this.button1.Name = "button1";

			this.button1.Size = new System.Drawing.Size(56, 23);

			this.button1.TabIndex = 20;

			this.button1.Text = "E&xit";

			this.button1.Click += new System.EventHandler(this.button1_Click);

			// 

			// label2

			// 

			this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));

			this.label2.Location = new System.Drawing.Point(16, 112);

			this.label2.Name = "label2";

			this.label2.Size = new System.Drawing.Size(192, 23);

			this.label2.TabIndex = 22;

			this.label2.Text = "Tel : (Iran)9802166872419";

			this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;

			// 

			// Form2

			// 

			this.AutoScaleBaseSize = new System.Drawing.Size(7, 15);

			this.ClientSize = new System.Drawing.Size(296, 181);

			this.Controls.Add(this.label2);

			this.Controls.Add(this.button1);

			this.Controls.Add(this.label7);

			this.Controls.Add(this.label8);

			this.Controls.Add(this.label4);

			this.Controls.Add(this.label3);

			this.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));

			this.Name = "Form2";

			this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;

			this.Text = "About";

			this.Load += new System.EventHandler(this.Form2_Load);

			this.ResumeLayout(false);



		}

		#endregion



		private void button1_Click(object sender, System.EventArgs e)

		{

			this.Hide();

		}



	

	

	

		private void Form2_Load(object sender, System.EventArgs e)

		{

			string pathprog=System.Environment.CurrentDirectory.ToString();

			pathprog=pathprog.Substring(0,pathprog.Length-9);

			string pathlabelbackground=pathprog+"Crane.bmp";

			this.label4.Image=System.Drawing.Image.FromFile(pathlabelbackground);

		}



		

	}

}

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
Other
Iran (Islamic Republic of) Iran (Islamic Republic of)
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions