Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Public Class funciones
- Public Shared Function ValidarCampoEntero(CajaDeTexto As TextBox) As Boolean
- Try
- Dim d As Integer = Convert.ToInt32(CajaDeTexto.Text)
- Return True
- Catch ex As Exception
- CajaDeTexto.Text = "0"
- CajaDeTexto.Select(0, CajaDeTexto.Text.Length)
- Return False
- End Try
- End Function
- Public Shared Function ValidarCampoDecimal(CajaDeTexto As TextBox) As Boolean
- Try
- Dim d As Decimal = Convert.ToDecimal(CajaDeTexto.Text)
- Return True
- Catch ex As Exception
- CajaDeTexto.Text = "0"
- CajaDeTexto.Select(0, CajaDeTexto.Text.Length)
- Return False
- End Try
- End Function
- End Class
Advertisement
Add Comment
Please, Sign In to add comment