vb.net 判断inputbox中输入信息


Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim str As String
        str = InputBox("123")

        If Len(str) > 0 Then
            '有输入并确定
            MessageBox.Show(str)
        Else
            '无输入或取消
            MessageBox.Show("no")
        End If
    End Sub
End Class


你可能感兴趣的:(vb.net 判断inputbox中输入信息)