⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frmdebugging.vb

📁 vb.net MCP课程的英文讲义,70-310课程,值得一读
💻 VB
字号:
Public Class frmDebugging
    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
    Friend WithEvents txtValue As System.Windows.Forms.TextBox
    Friend 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.TextBox()
        Me.btnDebug = New System.Windows.Forms.Button()
        Me.SuspendLayout()
        '
        'txtValue
        '
        Me.txtValue.Location = New System.Drawing.Point(24, 40)
        Me.txtValue.Name = "txtValue"
        Me.txtValue.TabIndex = 0
        Me.txtValue.Text = ""
        '
        'btnDebug
        '
        Me.btnDebug.Location = New System.Drawing.Point(152, 40)
        Me.btnDebug.Name = "btnDebug"
        Me.btnDebug.TabIndex = 1
        Me.btnDebug.Text = "Debug"
        '
        'frmDebugging
        '
        Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
        Me.ClientSize = New System.Drawing.Size(248, 85)
        Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.txtValue, Me.btnDebug})
        Me.Name = "frmDebugging"
        Me.Text = "Test Debugging"
        Me.ResumeLayout(False)

    End Sub

#End 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 Class

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -