using System; using System.Drawing; using System.Collections; using System.Windows.Forms; using System.Data; namespace drawing { /// /// Summary description for Form1. /// public class Form1 : System.Windows.Forms.Form { private System.Windows.Forms.Button button1; private System.Windows.Forms.MainMenu mainMenu1; public Form1() { // // Required for Windows Form Designer support // InitializeComponent(); // TODO: Add any constructor code after InitializeComponent call // } /// /// Clean up any resources being used. /// protected override void Dispose( bool disposing ) { base.Dispose( disposing ); } #region Windows Form Designer generated code /// /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// private void InitializeComponent() { this.mainMenu1 = new System.Windows.Forms.MainMenu(); this.button1 = new System.Windows.Forms.Button(); // // button1 // this.button1.Location = new System.Drawing.Point(160, 160); this.button1.Size = new System.Drawing.Size(64, 32); this.button1.Text = "Start!"; this.button1.Click += new System.EventHandler(this.button1_Click); // // Form1 // this.Controls.Add(this.button1); this.Menu = this.mainMenu1; this.Text = "Form1"; } #endregion /// /// The main entry point for the application. /// static void Main() { Application.Run(new Form1()); } private void button1_Click(object sender, System.EventArgs e) { System.Drawing.Graphics MyGraphicsObject = this.CreateGraphics(); for (int i=0; i<300; i++) { System.Threading.Thread.Sleep(20); MyGraphicsObject.FillRectangle(new System.Drawing.SolidBrush(System.Drawing.Color.White),10, 10, 200, 200); MyGraphicsObject.DrawString(""+i, new System.Drawing.Font("Arial",60.0f,System.Drawing.FontStyle.Bold), new System.Drawing.SolidBrush(System.Drawing.Color.Black), 20, 20); } } } }