|
Postada em 01/08/2008 23:53 hs
Private Sub Text1_KeyPress(KeyAscii As Integer) Select Case KeyAscii Case 8, 48 To 57 ' BackSpace e numericos Case Else ' o resto é travado KeyAscii = 0 End Select End Sub
Mas eu to querendo liberar a tecla " - " mas não to conseguindo de jeito nenhum... alguem da umal luz?
|
|
|
|
|
Postada em 02/08/2008 01:25 hs
Só acrescentar 45:
Case 8, 45, 48 To 57 ' BackSpace e numericos
45 é o valor ASCII de "-"
Falta uma linha, logo após essa:
KeyAscii = KeyAscii
|
|
|
Treze
|
SÃO VICENTE SP - BRASIL
|
|
Postada em 03/08/2008 03:59 hs
olha ai colega um codigo bom pra isso Private Sub Text1_KeyPress(KeyAscii As Integer) If Not ((KeyAscii >= Asc("0") And KeyAscii <= Asc("9")) Or KeyAscii = 8 Or KeyAscii = Asc("-")) Then KeyAscii = 0 Exit Sub End If End Sub
|
|
|