Jump to content

Recommended Posts

Posted

boas.... estou a desenvolver um projecto no qual tenho vários campos de inserção de dados(Text1.text......), porem ao não quero permitir a inserção de valores com pontos, por exemplo (3.2), quando inserir um valor assim quero inserir um msg de erro....

será que alguém me pode ajudar

.:: C ::. .::Haskell::. .::VB::. .::PHP::.

Posted

Olá

Poderás fazer assim :

'=================================

' Form:

' Criar 2 (duas) Textbox

'================================

'(pessoalmente acho que é uma rotina muito boa, onde poderás usar as teclas o BackSpace e o Del.)

Private Sub text1_KeyPress(KeyAscii As Integer)
    If KeyAscii = 13 Then
    'Salta para o proximo textbox ao pressionar enter        
     Text2.SetFocus
        KeyAscii = 0
    Else
        If KeyAscii <> 8 Then
            If InStr("0123456789", Chr(KeyAscii)) = 0 Then
                KeyAscii = 0
            End If
        End If
    End If
End Sub

Até+

Programadorvb6

______________________________________________________________________________

Que minha coragem seja maior que meu medo e que minha força seja tão grande quanto minha fé.
 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.