Visual Basic - textbox

Life is soft - evento anual de software empresarial
 
Vista:

textbox

Publicado por Alexht (12 intervenciones) el 12/02/2008 04:50:13
Como puedo hacer para que un textbox solo acepte un solo espacio entre palabras y no mas de uno espacio entre ellas
Gracias
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
sin imagen de perfil

RE:textbox

Publicado por Edwin (303 intervenciones) el 14/02/2008 01:57:27
En el evento Keypress del textbox

If Text1 = "" Then
Exit Sub
End If
If Len(Text1) > 2 Then
If Text1.SelStart <> 0 Then
If (Mid(Text1, Text1.SelStart, 1) = " " Or Mid(Text1, Text1.SelStart + 1, 1) = " ") And KeyAscii = 32 Then
KeyAscii = 0
End If
End If
End If
If Text1.SelStart = 0 And KeyAscii = 32 Then
KeyAscii = 0
End If
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar