From ebcff3a790ac780f3b01913f90502aa142d922f0 Mon Sep 17 00:00:00 2001 From: Dan Buch Date: Mon, 1 Aug 2011 23:10:28 -0400 Subject: [PATCH] holy smokes a diagonal line --- .gitignore | 3 ++ .../GraphicsPractice/Form1.Designer.cs | 42 +++++++++---------- GraphicsPractice/GraphicsPractice/Form1.cs | 15 ------- 3 files changed, 22 insertions(+), 38 deletions(-) diff --git a/.gitignore b/.gitignore index a432b93..3eb1382 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,9 @@ *.FileListAbsolute.txt *.dll *.pdb +*.exe +*.tlog +*.exe.manifest TwitterPractice/TwitterPractice/bin TwitterPractice/bin/EntityFramework.xml diff --git a/GraphicsPractice/GraphicsPractice/Form1.Designer.cs b/GraphicsPractice/GraphicsPractice/Form1.Designer.cs index 8f6bd89..aac4a26 100644 --- a/GraphicsPractice/GraphicsPractice/Form1.Designer.cs +++ b/GraphicsPractice/GraphicsPractice/Form1.Designer.cs @@ -1,4 +1,7 @@ -namespace GraphicsPractice +using System.Drawing; +using System.Windows.Forms; + +namespace GraphicsPractice { partial class Form1 { @@ -28,44 +31,37 @@ /// private void InitializeComponent() { - this.panel1 = new System.Windows.Forms.Panel(); - this.textBox1 = new System.Windows.Forms.TextBox(); - this.panel1.SuspendLayout(); + this.pictureBox1 = new System.Windows.Forms.PictureBox(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); this.SuspendLayout(); // - // panel1 - // - this.panel1.Controls.Add(this.textBox1); - this.panel1.Location = new System.Drawing.Point(13, 13); - this.panel1.Name = "panel1"; - this.panel1.Size = new System.Drawing.Size(259, 27); - this.panel1.TabIndex = 0; - // - // textBox1 + // pictureBox1 // - this.textBox1.Location = new System.Drawing.Point(3, 3); - this.textBox1.Name = "textBox1"; - this.textBox1.Size = new System.Drawing.Size(253, 20); - this.textBox1.TabIndex = 0; + this.pictureBox1.BackColor = System.Drawing.Color.White; + this.pictureBox1.Dock = System.Windows.Forms.DockStyle.Fill; + this.pictureBox1.Location = new System.Drawing.Point(0, 0); + this.pictureBox1.Name = "pictureBox1"; + this.pictureBox1.Size = new System.Drawing.Size(287, 242); + this.pictureBox1.TabIndex = 0; + this.pictureBox1.TabStop = false; + this.pictureBox1.Paint += new System.Windows.Forms.PaintEventHandler(this.pictureBox1_Paint); // // Form1 // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(281, 49); - this.Controls.Add(this.panel1); + this.ClientSize = new System.Drawing.Size(287, 242); + this.Controls.Add(this.pictureBox1); this.Name = "Form1"; this.Text = "Form1"; - this.panel1.ResumeLayout(false); - this.panel1.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); this.ResumeLayout(false); } #endregion - private System.Windows.Forms.Panel panel1; - private System.Windows.Forms.TextBox textBox1; + private PictureBox pictureBox1; } } diff --git a/GraphicsPractice/GraphicsPractice/Form1.cs b/GraphicsPractice/GraphicsPractice/Form1.cs index 709b97e..34b1a79 100644 --- a/GraphicsPractice/GraphicsPractice/Form1.cs +++ b/GraphicsPractice/GraphicsPractice/Form1.cs @@ -16,25 +16,11 @@ namespace GraphicsPractice // This example assumes that the Form_Load event handler method is // connected to the Load event of the form. - private PictureBox pictureBox1 = new PictureBox(); public Form1() { InitializeComponent(); } - private void Form1_Load(object sender, System.EventArgs e) - { - // Dock the PictureBox to the form and set its background to white. - pictureBox1.Dock = DockStyle.Fill; - pictureBox1.BackColor = Color.White; - // Connect the Paint event of the PictureBox to the event handler method. - pictureBox1.Paint += new System.Windows.Forms.PaintEventHandler(this.pictureBox1_Paint); - - // Add the PictureBox control to the Form. - this.Controls.Add(pictureBox1); - MessageBox.Show("End Form1_Load"); - } - private void pictureBox1_Paint(object sender, System.Windows.Forms.PaintEventArgs e) { // Create a local version of the graphics object for the PictureBox. @@ -47,7 +33,6 @@ namespace GraphicsPractice g.DrawLine(System.Drawing.Pens.Red, pictureBox1.Left, pictureBox1.Top, pictureBox1.Right, pictureBox1.Bottom); g.Flush(); - MessageBox.Show("End pictureBox1_Paint"); } } }