' Project ClickCounter ' Count the number of clicks on the Click Me button. ' Rerun the project after uncommenting the next line. ' Option Strict On Public Class Form1 Inherits System.Windows.Forms.Form #Region " Windows Form Designer generated code " Public Sub New() MyBase.New() 'This call is required by the Windows Form Designer. InitializeComponent() 'Add any initialization after the InitializeComponent() call End Sub 'Form overrides dispose to clean up the component list. Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean) If disposing Then If Not (components Is Nothing) Then components.Dispose() End If End If MyBase.Dispose(disposing) End Sub 'Required by the Windows Form Designer Private components As System.ComponentModel.IContainer 'NOTE: The following procedure is required by the Windows Form Designer 'It can be modified using the Windows Form Designer. 'Do not modify it using the code editor. Friend WithEvents btnClick As System.Windows.Forms.Button Friend WithEvents btnReset As System.Windows.Forms.Button Friend WithEvents txtCount As System.Windows.Forms.TextBox Private Sub InitializeComponent() Me.btnClick = New System.Windows.Forms.Button Me.txtCount = New System.Windows.Forms.TextBox Me.btnReset = New System.Windows.Forms.Button Me.SuspendLayout() ' 'btnClick ' Me.btnClick.Font = New System.Drawing.Font("Microsoft Sans Serif", 14.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.btnClick.Location = New System.Drawing.Point(24, 16) Me.btnClick.Name = "btnClick" Me.btnClick.Size = New System.Drawing.Size(192, 40) Me.btnClick.TabIndex = 0 Me.btnClick.Text = "Click Me" ' 'txtCount ' Me.txtCount.Font = New System.Drawing.Font("Microsoft Sans Serif", 14.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.txtCount.Location = New System.Drawing.Point(24, 72) Me.txtCount.Name = "txtCount" Me.txtCount.ReadOnly = True Me.txtCount.Size = New System.Drawing.Size(192, 29) Me.txtCount.TabIndex = 1 Me.txtCount.Text = "0" ' 'btnReset ' Me.btnReset.Font = New System.Drawing.Font("Microsoft Sans Serif", 14.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.btnReset.Location = New System.Drawing.Point(24, 152) Me.btnReset.Name = "btnReset" Me.btnReset.Size = New System.Drawing.Size(192, 40) Me.btnReset.TabIndex = 2 Me.btnReset.Text = "Reset" ' 'Form1 ' Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13) Me.ClientSize = New System.Drawing.Size(240, 206) Me.Controls.Add(Me.btnReset) Me.Controls.Add(Me.txtCount) Me.Controls.Add(Me.btnClick) Me.Name = "Form1" Me.Text = "ClickCounter Project" Me.ResumeLayout(False) End Sub #End Region ' Event handler for btnClick button. Private Sub btnClick_Click(ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles btnClick.Click txtCount.Text = txtCount.Text + 1 End Sub ' Event handler for btnReset button. Private Sub btnReset_Click(ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles btnReset.Click txtCount.Text = 0 End Sub End Class