Hola a todos, he visto que le vb 6, no tiene una opción especifica como tienen las celdas de una hoja de calculo, donde uno le puede dar la mascara, es decir, como quiero que ingrese los datos, y no estoy hablando del formato que el texbox de vb 6, si lo tiene. Luego de mucho pensar y buscar termine programando un textbox con mascara, al menos eso es en apariencia aunque sea el mismo texto nada mas que muy programado.
Bueno acá el código, si tiene algún problema comenten
Dim Uso As Integer
Private Sub Form_Load()
Uso = 0
End Sub
Private Sub Text1_Change()
If Uso = 0 Then
If Len(Text1) = 1 Then
Text1.Text = Text1.Text & "0.000.000"
Text1.SelStart = Len(Text1)
Text1 = FormatNumber(Text1, 0)
Text1.SelStart = 1
Text1.SelLength = Len(Text1) - 1
End If
If Len(Text1) = 2 Then
Text1.Text = Text1.Text & ".000.000"
Text1.SelStart = Len(Text1)
Text1 = FormatNumber(Text1, 0)
Text1.SelStart = 3
Text1.SelLength = Len(Text1) - 3
End If
If Len(Text1) = 4 Then
Text1.Text = Text1.Text & "00.000"
Text1.SelStart = Len(Text1)
Text1 = FormatNumber(Text1, 0)
Text1.SelStart = 4
Text1.SelLength = Len(Text1) - 4
End If
If Len(Text1) = 5 Then
Text1.Text = Text1.Text & "0.000"
Text1.SelStart = Len(Text1)
Text1 = FormatNumber(Text1, 0)
Text1.SelStart = 5
Text1.SelLength = Len(Text1) - 5
End If
If Len(Text1) = 6 Then
Text1.Text = Text1.Text & ".000"
Text1.SelStart = Len(Text1)
Text1 = FormatNumber(Text1, 0)
Text1.SelStart = 7
Text1.SelLength = Len(Text1) - 6
End If
If Len(Text1) = 8 Then
Text1.Text = Text1.Text & "00"
Text1.SelStart = Len(Text1)
Text1 = FormatNumber(Text1, 0)
Text1.SelStart = 8
Text1.SelLength = Len(Text1) - 8
End If
If Len(Text1) = 9 Then
Text1.Text = Text1.Text & "0"
Text1.SelStart = Len(Text1)
Text1 = FormatNumber(Text1, 0)
Text1.SelStart = 9
Text1.SelLength = Len(Text1) - 9
End If
End If
End Sub
Private Sub Text1_GotFocus()
Text1.SelLength = Len(Text1)
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 46 Or KeyAscii = 8 Then
Uso = 1
Else
Uso = 0
End If
End Sub
Disfruten, compartir es la solución.-