Visual Basic - autocompletar desde un texbox

Life is soft - evento anual de software empresarial
 
Vista:

autocompletar desde un texbox

Publicado por sergio (3 intervenciones) el 26/03/2004 15:44:06
Por favor si alguien me puede ayudar no se como se hace para autocompletar en un texbox .
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:autocompletar desde un texbox

Publicado por Fabian (501 intervenciones) el 26/03/2004 20:05:08
Haber mira primero, coloca un TextBox CON LA PROPIEDAD TEXT EN BLANCO y un Label en tu Form, en el Label escribe lo que desees y luego:
Dim Logico as Boolean

Private Sub Text6_Change()
Dim Valor1 As Integer
Valor1 = Len(Text6.Text)
If Not Trim(Text6.Text) = "" Then
If Mid(Text6.Text, 1, Len(Text6.Text)) = Mid(Label1.Caption, 1, Len(Text6.Text)) Then
Text6.Text = Text6.Text & Mid(Label1.Caption, Valor1 + 1, Len(Label1.Caption))
Text6.SelStart = Valor1
Text6.SelLength = Len(Text6.Text)
Logico = False
End If
Else
Logico = True
End If
End Sub

Private Sub Text6_KeyPress(KeyAscii As Integer)
Borrado (KeyAscii)
End Sub

'Esto ultimo es para borrar con el BackSpace:
Sub Borrado(KeyAscii)
Dim Texto2 As String
If KeyAscii = 8 And Logico = False Then
If Len(Text6.Text) = 1 Then
Text6.Text = ""
ElseIf Len(Text6.Text) > 1 Then
Texto2 = Mid(Text6, 1, Text6.SelStart - 1)
Text6.Text = Texto2
End If
End If
End Sub

espero te sirva puesto que seguramente lo querras hacer buscando registros de una BD.

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