Results 1 to 4 of 4

Thread: [RESOLVED] Strange occurance with Listbox

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Nov 2010
    Posts
    185

    Resolved [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?

  2. #2
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    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
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Nov 2010
    Posts
    185

    Re: Strange occurance with Listbox

    Yep, dumb programmer error. Trying to avoid one 'problem' and created another instead.

  4. #4
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: Strange occurance with Listbox

    Quote Originally Posted by hijack View Post
    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.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width