|
What are the Using Statements For?
using
System; //basic tools for controls, variables, event handlers, much more!using
System.Collections.Generic; // Adds collections/arraysusing
System.ComponentModel; //manages/implements how controls workusing
System.Data; //file I/Ousing
System.Drawing; //Graphical Design Interface GDI+:two-dimensional vector graphics/imaging.using
System.Text; //ASCII & unicode characters (American Standards Committee for Information Interchange)using
System.Windows.Forms; //Ability to make windows apps with all the controls/featuresnamespace
WindowsApplication1{
public partial class Form1 : Form{
public Form1() //this method is made for us and calls the InitializeComponent method. See Form1.Designer.CS
{
InitializeComponent();
}
}
}
This method is in the Form1.Designer.CS file. This is where our controls are created! VS builds all this for us.
private void InitializeComponent()this.textBox1 = new System.Windows.Forms.TextBox(); this.textBox2 = new System.Windows.Forms.TextBox(); this.btnOK = new System.Windows.Forms.Button(); this.btnClear = new System.Windows.Forms.Button(); this.btnExit = new System.Windows.Forms.Button(); this.label1 = new System.Windows.Forms.Label(); this.SuspendLayout(); // // textBox1 // this.textBox1.Location = new System.Drawing.Point(53, 56); this.textBox1.Name = "textBox1"; this.textBox1.Size = new System.Drawing.Size(100, 20); this.textBox1.TabIndex = 0; // // textBox2 // this.textBox2.Location = new System.Drawing.Point(53, 97); this.textBox2.Name = "textBox2"; this.textBox2.Size = new System.Drawing.Size(100, 20); this.textBox2.TabIndex = 1; // // btnOK // this.btnOK.Location = new System.Drawing.Point(205, 56); this.btnOK.Name = "btnOK"; this.btnOK.Size = new System.Drawing.Size(75, 23); this.btnOK.TabIndex = 2; this.btnOK.Text = "OK"; this.btnOK.UseVisualStyleBackColor = true; this.btnOK.Click += new System.EventHandler(this.btnOK_Click); // // btnClear // this.btnClear.Location = new System.Drawing.Point(205, 93); this.btnClear.Name = "btnClear"; this.btnClear.Size = new System.Drawing.Size(75, 23); this.btnClear.TabIndex = 3; this.btnClear.Text = "Clear"; this.btnClear.UseVisualStyleBackColor = true; this.btnClear.Click += new System.EventHandler(this.btnClear_Click); //{