Visual Basic - solo introducir vocales

Life is soft - evento anual de software empresarial
 
Vista:

solo introducir vocales

Publicado por glendiux (1 intervención) el 11/11/2009 02:13:06
hola, estoy haciendo uan tarea pero ya me atore, necesito hacer ke en un textbox me acepte solo vocales, no se como hacerle, me ayudarian porfavor , estoy usando visual basic studio 2008

gracias chicos
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

RE:solo introducir vocales

Publicado por juan carlos (518 intervenciones) el 11/11/2009 04:19:16
Hola Glendiux esto lo hice en vb6
intenta meter algo al text1 aparte de vocales con esto

Private Sub Text1_KeyPress(KeyAscii As Integer)
If (KeyAscii > "32") And (KeyAscii < "65") Then KeyAscii = 0
If (KeyAscii > "65") And (KeyAscii < "69") Then KeyAscii = 0
If (KeyAscii > "69") And (KeyAscii < "73") Then KeyAscii = 0
If (KeyAscii > "73") And (KeyAscii < "79") Then KeyAscii = 0
If (KeyAscii > "79") And (KeyAscii < "85") Then KeyAscii = 0
If (KeyAscii > "85") And (KeyAscii < "90") Then KeyAscii = 0
If (KeyAscii = "90") Then KeyAscii = 0

If (KeyAscii > "47") And (KeyAscii < "58") Then KeyAscii = 0
If (KeyAscii > "97") And (KeyAscii < "101") Then KeyAscii = 0
If (KeyAscii > "101") And (KeyAscii < "105") Then KeyAscii = 0
If (KeyAscii > "105") And (KeyAscii < "111") Then KeyAscii = 0
If (KeyAscii > "111") And (KeyAscii < "117") Then KeyAscii = 0
If (KeyAscii > "117") And (KeyAscii < "122") Then KeyAscii = 0
If (KeyAscii = "122") Then KeyAscii = 0
If (KeyAscii > "122") Then KeyAscii = 0
End Sub
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

OTRA DE LAS TUYAS!!!!!

Publicado por El Guarro (1 intervención) el 11/11/2009 16:15:20
¿NO TE CANSAS DE CONTESTAR BURRADAS, COMO SIEMPRE?
¿¿¿¿¿DESDE CUANDO EL VALOR DE KEYASCII (QUE ES NUMÉRICO) SE COMPARA ENTRE COMILLAS??????
ADEMÁS DE QUE TUS COMPARACIONES VALEN PARA PURA MAD...

SI LO QUE ESTAN PIDIENDO ES QUE SOLO ACEPTE VOCALES, ESTA ES LA FORMA (ASÍ DE SIMPLE, SIN TANTA FREGADERA QUE PUSISTE):

Private Sub Text1_KeyPress(Index As Integer, KeyAscii As Integer)
If InStr("AEIOU", UCase(Chr(KeyAscii))) = 0 Then KeyAscii = 0
End Sub
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

RE:OTRA DE LAS TUYAS!!!!!

Publicado por juan carlos (518 intervenciones) el 12/11/2009 02:30:58
Gracias por tu observacion Guarro la tendre en mente, veo que eres muy buen programador recuerda que dia a dia estamos aprendiendo, ahhh me gusto tu codigo es mejor que mis burradas de siempre
te preguntaras ¿Porque no me contestó como espere ser contestado? la respuesta es que soy cristiano y no gano nada de decir cosas que no debo de decir
si deseas comunicarte conmigo mi mail es

[email protected]
espero tu mensaje

Dios te bendiga siempre en todo
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

gracias, lo simplifique asi

Publicado por GLENDIUX (1 intervención) el 11/11/2009 16:42:07
gracias por tu ayuda, aunke no me sirvio el codigo porque yo uso vb 2008 lo hice de la siguiente manera

Private Sub TextBox2_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox2.KeyPress

If e.KeyChar = Chr(65) Or e.KeyChar = Chr(69) Or e.KeyChar = Chr(73) Or e.KeyChar = Chr(79) Or e.KeyChar = Chr(85) Then

Else
e.KeyChar = Chr(0)
End If
End Sub

muchas gracias
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

RE:gracias, lo simplifique asi

Publicado por jaime guerrero (361 intervenciones) el 11/11/2009 18:31:00
glendiux

este es el foro de vb clasico no de .net. para eso hay otro foro que esta mas a bajo

ya para la proxima pon tus dudas en ese foro
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