holy smokes a diagonal line

This commit is contained in:
Dan Buch 2011-08-01 23:10:28 -04:00
parent b3b2eef162
commit ebcff3a790
3 changed files with 22 additions and 38 deletions

3
.gitignore vendored
View File

@ -5,6 +5,9 @@
*.FileListAbsolute.txt *.FileListAbsolute.txt
*.dll *.dll
*.pdb *.pdb
*.exe
*.tlog
*.exe.manifest
TwitterPractice/TwitterPractice/bin TwitterPractice/TwitterPractice/bin
TwitterPractice/bin/EntityFramework.xml TwitterPractice/bin/EntityFramework.xml

View File

@ -1,4 +1,7 @@
namespace GraphicsPractice using System.Drawing;
using System.Windows.Forms;
namespace GraphicsPractice
{ {
partial class Form1 partial class Form1
{ {
@ -28,44 +31,37 @@
/// </summary> /// </summary>
private void InitializeComponent() private void InitializeComponent()
{ {
this.panel1 = new System.Windows.Forms.Panel(); this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.textBox1 = new System.Windows.Forms.TextBox(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
this.panel1.SuspendLayout();
this.SuspendLayout(); this.SuspendLayout();
// //
// panel1 // pictureBox1
// //
this.panel1.Controls.Add(this.textBox1); this.pictureBox1.BackColor = System.Drawing.Color.White;
this.panel1.Location = new System.Drawing.Point(13, 13); this.pictureBox1.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel1.Name = "panel1"; this.pictureBox1.Location = new System.Drawing.Point(0, 0);
this.panel1.Size = new System.Drawing.Size(259, 27); this.pictureBox1.Name = "pictureBox1";
this.panel1.TabIndex = 0; this.pictureBox1.Size = new System.Drawing.Size(287, 242);
// this.pictureBox1.TabIndex = 0;
// textBox1 this.pictureBox1.TabStop = false;
// this.pictureBox1.Paint += new System.Windows.Forms.PaintEventHandler(this.pictureBox1_Paint);
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;
// //
// Form1 // Form1
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(281, 49); this.ClientSize = new System.Drawing.Size(287, 242);
this.Controls.Add(this.panel1); this.Controls.Add(this.pictureBox1);
this.Name = "Form1"; this.Name = "Form1";
this.Text = "Form1"; this.Text = "Form1";
this.panel1.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
this.panel1.PerformLayout();
this.ResumeLayout(false); this.ResumeLayout(false);
} }
#endregion #endregion
private System.Windows.Forms.Panel panel1; private PictureBox pictureBox1;
private System.Windows.Forms.TextBox textBox1;
} }
} }

View File

@ -16,25 +16,11 @@ namespace GraphicsPractice
// This example assumes that the Form_Load event handler method is // This example assumes that the Form_Load event handler method is
// connected to the Load event of the form. // connected to the Load event of the form.
private PictureBox pictureBox1 = new PictureBox();
public Form1() public Form1()
{ {
InitializeComponent(); 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) private void pictureBox1_Paint(object sender, System.Windows.Forms.PaintEventArgs e)
{ {
// Create a local version of the graphics object for the PictureBox. // 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, g.DrawLine(System.Drawing.Pens.Red, pictureBox1.Left, pictureBox1.Top,
pictureBox1.Right, pictureBox1.Bottom); pictureBox1.Right, pictureBox1.Bottom);
g.Flush(); g.Flush();
MessageBox.Show("End pictureBox1_Paint");
} }
} }
} }