|
-
Aug 10th, 2006, 06:06 AM
#1
Thread Starter
Addicted Member
listbox array
Hi there,
can somebody show me how to retrieve all the items from the listbox for my gethistory sub.
VB Code:
Sub GetHistory(Index As Integer, Msg As String)
Dim a As Integer
End Sub
' using Time makes the listbox flicker for some reason, o well
VB Code:
Public Sub AddHistory(Msg As String)
On Error Resume Next
Dim a As Integer
List1.AddItem Time & Msg, 0
If List1.ListCount = 11 Then
List1.RemoveItem 10
End If
End Sub
Last edited by mrnew; Aug 10th, 2006 at 06:10 AM.
-
Aug 10th, 2006, 06:30 AM
#2
Re: listbox array
I'm not sure I understand. Your GetHistory Sub has an argument called Index, shouldn't that be the index of the item you want to retrieve? Anyway, to show each item in a listbox you simply have to loop through it.
VB Code:
Dim i As Integer
For i = 0 To List1.ListCount - 1
MsgBox List1.List(i)
Next
-
Aug 10th, 2006, 06:35 AM
#3
Thread Starter
Addicted Member
Re: listbox array
was just example code for an online game index is used to identify which player, btw, thanks alot
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
|