Log in

View Full Version : List box to text box one by one in vb6


jram1507
Mar 1, 2010, 08:09 AM
I am working with vb6 & I am novice too.

I have 5 text boxes and only one list box and I want to select list from list box to text box one after another. It is a single list only to text box.

With advanced thanks

S. Jeyaraman

steadysimple
Mar 28, 2010, 07:34 PM
1) Rename your textbox to Text1, Text2, Text3, Text4 and Text5.
2) Double click List1. The code should be like this:-
Private Sub List1_Click()
List1.ListIndex=0
Text1.Text=List1.Text
List1.ListIndex=1
Text2.Text=List1.Text
List1.ListIndex=2
Text3.Text=List1.Text
List1.ListIndex=3
Text4.Text=List1.Text
List1.ListIndex=4
Text5.Text=List1.Text
End Sub