Visual Basic.NET - Necesito una validacion para el sigueinte codigo

 
Vista:

Necesito una validacion para el sigueinte codigo

Publicado por Washington Olvera (1 intervención) el 15/11/2012 03:35:40
Buenas noches necesito un codigo para programa en Visual Basic.Net 2008 o 2010 del programa de validaciones para validar una caja de texto que ingrese números decimales (solo un punto decimal) en el siguiente codigo:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
Public Class frmIngreso
 
 
    Private Sub txtApellido_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtApellido.KeyPress
        If Char.IsLetter(e.KeyChar) Then
            e.Handled = False
        ElseIf Char.IsSeparator(e.KeyChar) Then
            e.Handled = False
        ElseIf Char.IsControl(e.KeyChar) Then
            e.Handled = False
        Else
            e.Handled = True
        End If
    End Sub
 
 
    Private Sub txtIngreso_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtIngreso.KeyPress
        If Char.IsNumber(e.KeyChar) Then
            e.Handled = False
        ElseIf Char.IsPunctuation(e.KeyChar) Then
            e.Handled = False
        ElseIf Char.IsControl(e.KeyChar) Then
            e.Handled = False
        Else
            e.Handled = True
        End If
        'Dim x As Integer
        'x = InStr("1234.45", ".")
 
    End Sub
 
    Private Sub txtApellido_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtApellido.TextChanged
 
    End Sub
End Class


de antemano les quedo eternamente agradecido ok
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder