[RESOLVED] Strange occurance with Listbox
Did some reorganizing of my program and have finally gotten most everything back to where I started before only handled better/more orderly than before. I think I have a few problems removed as well that I had before.
One thing has come up now that seems a bit strange.
Code:
Private Sub ListDisplay()
List1.Clear
List2.Clear
For Counter2 = 0 To eFileCounter
If eDownloaded(Counter2) = "0" Then
List1.AddItem eDate(Counter2) & eSize(Counter2) & "/" & eUser(Counter2)
Else
List2.AddItem eFile(Counter2)
End If
Next Counter2
End Sub
This code is the only code that Additem to either List1 or List2. When it adds to List1 it does so fine, it starts right at the top of the listbox. When it puts the first entry into List2 it starts down one line instead starting right at the top of the box. Yes, as it looks through eDownloaded some entries may be 0 and some maybe 1. That shouldn't make any difference though. I just checked and had the first entry being a "1" and it still put it down on the second line in List2 while List1 still started right at the top of the box. Looking through all the settings are the same for both boxes, other than Sorted. Changing that just a moment ago made no difference either.
Is there anyway to correct the problem?
Re: Strange occurance with Listbox
I think you will find that it doesn't start down 1 line as it appears. I think you'll find that the first eFile(Counter2) is a blank string or possibly some unprintable characters.
You can test this temporarily by appending something to that list item
Code:
List2.AddItem eFile(Counter2) & "< " & Counter2
When the 1st item is added to List2, now you'll know which eFile() entry it is & you can determine why its value is what it is
Re: Strange occurance with Listbox
Yep, dumb programmer error. Trying to avoid one 'problem' and created another instead.
Re: Strange occurance with Listbox
Quote:
Originally Posted by
hijack
Yep, dumb programmer error. Trying to avoid one 'problem' and created another instead.
Happens to all of us, welcome to the club ;)
BTW. Whenever you experience a "strange behavior" with a control, odds are it isn't the control but something you did elsewhere. Though some controls may have an odd behavior or two, they are usually well-known and documented/commented about throughout the VB world.