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
Friend WithEvents txtValue As System.Windows.Forms.TextBoxFriend WithEvents btnDebug As System.Windows.Forms.Button'Required by the Windows Form Designer
Private components As System.ComponentModel.Container'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.
<System.Diagnostics.DebuggerStepThrough()>
Private Sub InitializeComponent()Me.txtValue = New System.Windows.Forms.TextBoxMe.btnDebug = New System.Windows.Forms.ButtonMe.SuspendLayout()'
'txtValue
'
Me.txtValue.Location = New System.Drawing.Point(24, 40)Me.txtValue.Name = "txtValue"
Me.txtValue.Size = New System.Drawing.Size(100, 20)Me.txtValue.TabIndex = 0'
'btnDebug
'
Me.btnDebug.Location = New System.Drawing.Point(152, 40)Me.btnDebug.Name = "btnDebug"
Me.btnDebug.Size = New System.Drawing.Size(75, 23)Me.btnDebug.TabIndex = 1Me.btnDebug.Text = "Debug"
'
'frmDebugging
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)Me.ClientSize = New System.Drawing.Size(248, 85)Me.Controls.Add(Me.txtValue)Me.Controls.Add(Me.btnDebug)Me.Name = "frmDebugging"
Me.Text = "Test Debugging"
#End
Me.ResumeLayout(False)Me.PerformLayout()End Sub Region
'---------------------------
'Examine code from this point onwards
'TODO Put a breakpoint on the following line.
Private Sub btnDebug_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDebug.Click'call the PerformValidation sub passing in the value from the textbox
PerformValidation(txtValue.Text)
End Sub
Sub PerformValidation(ByVal strValue As String)'check if a value was passed in the string
If strValue = "" Then
'display an error if no value found
MsgBox(
"No value has been entered", MsgBoxStyle.Critical, "Error")Else
'display the passed in value if successful
MsgBox(
"The value entered was: " & strValue, MsgBoxStyle.Information, "Success")End If
End Sub
End
Private Sub frmDebugging_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.LoadEnd Sub Class