|
-
Nov 5th, 2000, 04:41 PM
#1
Thread Starter
New Member
I need to Display all of the items in a list box onto a Label control! Does anyone have an idea about how to do this! I tried using a Do Until loop but it doesn't stop and it displays the first item then when it loops it displays the next and the first one is no longer there! Please help!
Thanks
Jamie
-
Nov 5th, 2000, 04:47 PM
#2
Change your label's WordWrap property to True.
-
Nov 5th, 2000, 04:56 PM
#3
Thread Starter
New Member
Tried it and it didn't work!
Here's the code!
Private Sub cmdCheckOut_Click()
Dim I As Integer
Dim c As Integer
c = List1.ListCount
I = List1.ListIndex
Do Until List1.ListIndex = List1.ListCount
Label4.Caption = List1.List(I)
I = I + 1
Loop
-
Nov 5th, 2000, 05:01 PM
#4
This line of code is the problem
Label4.Caption = List1.List(I)
You are telling VB to replace the label's content every time you loop.
Do this instead
Label4.Caption = Label4.caption & List1.List(I)
or
Label4.Caption = Label4.caption & List1.List(I) & vbCrLF
They both tell VB to append the new vale to what is already there.
-
Nov 5th, 2000, 05:14 PM
#5
Thread Starter
New Member
Thanks! Now All I have to do is figure out how to stop it! I'm just learning and this is an assignment so I'll keep digging into my books!
Thanks again
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|