Neznam dali sam dobro razumio pitanje al probaj ovaj kod za ubacivanje iz textbox-a u listbox pa sebi iskombinuj.
Code:
Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
Dim I As Integer
Dim S As String
I = List1.ListCount
S = Text1.Text
If S = "" Then
If List1.List(I - 1) <> "" Then
List1.AddItem ""
End If
End If
End Sub
Private Sub Text1_KeyUp(KeyCode As Integer, Shift As Integer)
Dim I As Integer
Dim S As String
I = List1.ListCount
S = Text1.Text
If KeyCode = 13 Then
Text1.Text = ""
Exit Sub
Else
If I <> 0 Then
List1.RemoveItem (I - 1)
End If
End If
List1.AddItem S
End Sub