h1.post-title { color:orange; font-family:verdana,Arial; font-weight:bold; padding-bottom:5px; text-shadow:#64665b 0px 1px 1px; font-size:32px; } -->

Pages

Check Input Value 0 To 4 in VB.Net

 Dim chk As Boolean
    Function IsChekcInputValue(ByVal number As Double) As Boolean
        If number = 0 Or number = 1 Or number = 2 Or number = 3 Or number = 4 Then
            Return True
        Else
            Return False
        End If
    End Function

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        For I As Integer = 0 To Trim(TextBox1.Text.Length) 
            chk = IsChekcInputValue(TextBox1.Text.IndexOf(I))
        Next
        If chk = False Then
            MsgBox("Please Enter 0 To 4 Numbers in Input Box")
        Else
            MsgBox("Thank U")
        End If
    End Sub

    Private Sub TextBox1_KeyPress(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress
        If Char.IsNumber(e.KeyChar) = False Then
            e.Handled = True
        End If
    End Sub