Quantcast
Channel: Windows Forms Data Controls and Databinding forum
Viewing all articles
Browse latest Browse all 2535

convert single value to one decimal and allow value not more than 99999

$
0
0

 

i want that text box allow value not more than 99999 and 

i want if i type in text box 9 then it convert to 9.0

following code i try, for in put number only its work fine,

Private Sub TextBox5_TextChanged(sender As Object, e As EventArgs) Handles TextBox5.TextChanged

TextBox5.Text = Format(Convert.ToSingle(TextBox5.Text), "#.#") this line not work
        If TextBox5.Text = "" Then
            GoTo ex
        Else
            If IsNumeric(TextBox5.Text) Then
                GoTo ex
            Else
                MsgBox("Please Input The Numbers Only !", vbCritical)
                TextBox5.Text = ""
                searchback()
            End If
        End If
ex:
        Exit Sub
    End Sub

 

Viewing all articles
Browse latest Browse all 2535

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>