public partial class Form1 : Form { int i = 0; public Form1() { InitializeComponent(); timer1.Enabled = true; } private void timer1_Tick(object sender, EventArgs e) { this.textBox1.Text = ""; this.textBox1.Text = "Timer ticked event called " + i + " times"; i++; } } /// /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// private void InitializeComponent() { this.components = new System.ComponentModel.Container(); this.textBox1 = new System.Windows.Forms.TextBox(); this.timer1 = new System.Windows.Forms.Timer(this.components); this.SuspendLayout(); // // textBox1 // this.textBox1.Location = new System.Drawing.Point(12, 88); this.textBox1.Name = "textBox1"; this.textBox1.Size = new System.Drawing.Size(268, 20); this.textBox1.TabIndex = 0; // // timer1 // this.timer1.Tick += new System.EventHandler(this.timer1_Tick); // // Form1 // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(292, 266); this.Controls.Add(this.textBox1); this.Name = "Form1"; this.Text = "Form1"; this.ResumeLayout(false); this.PerformLayout(); }