combinar un texbox y un combobox
Publicado por FERNANDO (1 intervención) el 14/11/2003 00:46:06
He combinadoun textbox y un combobox con este codigo. Hay otra forma de hacerlo mejor.
En el Textbox solo voy a introducir numeros de 4 cifras y en el combobox me devuelve texto.
Private Sub ComboBox1_Change()
If ComboBox1.ListIndex = 0 Then
TextBox1 = "2048"
End If
If ComboBox1.ListIndex = 1 Then
TextBox1 = "0043"
End If
If TextBox1 = "0085" Then
ComboBox1.ListIndex = 2
End If
If TextBox1 = "0182" Then
ComboBox1.ListIndex = 3
End If
End Sub
Private Sub TextBox1_Change()
If TextBox1 = "2048" Then
ComboBox1.ListIndex = 0
End If
If TextBox1 = "0043" Then
ComboBox1.ListIndex = 1
End If
If TextBox1 = "0085" Then
ComboBox1.ListIndex = 2
End If
If TextBox1 = "0182" Then
ComboBox1.ListIndex = 3
End If
End Sub
En el Textbox solo voy a introducir numeros de 4 cifras y en el combobox me devuelve texto.
Private Sub ComboBox1_Change()
If ComboBox1.ListIndex = 0 Then
TextBox1 = "2048"
End If
If ComboBox1.ListIndex = 1 Then
TextBox1 = "0043"
End If
If TextBox1 = "0085" Then
ComboBox1.ListIndex = 2
End If
If TextBox1 = "0182" Then
ComboBox1.ListIndex = 3
End If
End Sub
Private Sub TextBox1_Change()
If TextBox1 = "2048" Then
ComboBox1.ListIndex = 0
End If
If TextBox1 = "0043" Then
ComboBox1.ListIndex = 1
End If
If TextBox1 = "0085" Then
ComboBox1.ListIndex = 2
End If
If TextBox1 = "0182" Then
ComboBox1.ListIndex = 3
End If
End Sub
Valora esta pregunta


0