Results 1 to 8 of 8

Thread: [RESOLVED] Getting black blocks after Item entry in ListBox if Windows XP is being used

  1. #1

    Thread Starter
    Fanatic Member EntityX's Avatar
    Join Date
    Feb 2007
    Location
    Omnipresence
    Posts
    798

    Resolved [RESOLVED] Getting black blocks after Item entry in ListBox if Windows XP is being used

    I've been testing an application I'm working on in Windows 7, Vista and XP. If I'm using XP then I get a couple of solid black blocks after the items listed in the ListBox. They are absent when running the same application in Vista or 7. I have the enable application framework checkbox unchecked. I haven't tried changing that to see if it makes a difference.
    Attached Images Attached Images  
    Last edited by EntityX; Jul 28th, 2011 at 04:08 PM.
    Make as many mistakes as you can as quickly as you can. We want to make sure that we make a great enough number of mistakes in a given amount of time so that we can be successful.

    "Persistence is the magic of success." Paramahansa Yogananda

  2. #2
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    26,422

    Re: Getting black blocks after Item entry in ListBox if Windows XP is being used

    how do you add the items to the listbox + where do you get them from?
    can you show us your code?

  3. #3
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    26,422

    Re: Getting black blocks after Item entry in ListBox if Windows XP is being used

    those blocks are unprintable or non visual characters.
    are the entries null terminated strings?

  4. #4

    Thread Starter
    Fanatic Member EntityX's Avatar
    Join Date
    Feb 2007
    Location
    Omnipresence
    Posts
    798

    Re: Getting black blocks after Item entry in ListBox if Windows XP is being used

    Here's the Sub that checks to see what saved screens are in a particular series and then populates the ListBox with those screens. I chopped out some of the nonessential code that would be completely unrelated to the ListBox.

    Code:
      Sub FindSavedScreensForSeries()
            adec = 0 ' generic variable used to upwardly increment ScreenNumber
            bd1 = 1 ' generic variable used to increment bd by either 1 or 0.1
            bd2 = 0 ' generic variable used to count how many times no file is found if integer values are used for bd
            st1 = ""
            a = 1
            Do Until StringForListBox(a) = "" ' empty array
                StringForListBox(a) = ""
                a += 1
            Loop
            a = 1
            Do
                If File.Exists(PathToPersonalScreens & "\" & Folder4PS & "\" & IDCodewDashOrN & "Series" & Series & "ScreenNumber" & adec & ".txt") Then
                    StringForListBox(a) = "Series " & Series & " ScreenNumber " & adec & R
                    a += 1
                    bd2 = 0
                Else
                    bd2 += 1
                End If
                adec = CDec(adec + 0.01)
            Loop Until bd2 > 2500 ' will show screens spaced 25 apart but not more
           
            ListBoxDisplaySavedScreens.Items.Clear()
            If StringForListBox(1) = "" Then
                ListBoxDisplaySavedScreens.SelectionMode = SelectionMode.None
                LblListBoxMessageScreens.Text = ""
                LblDeleteMessage.Visible = False
            Else
    
                a = 1
                Do Until StringForListBox(a) = ""
                    ListBoxDisplaySavedScreens.Items.Add(StringForListBox(a))
                    a += 1
                Loop
                ListBoxDisplaySavedScreens.SelectionMode = SelectionMode.MultiExtended
                    
            End If
        End Sub



    I created another project from scratch and added a ListBox and this code.

    Code:
     Dim StringForListBox(9) As String
        Dim a As Integer
    
        Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
            StringForListBox(1) = "Series 1 ScreenNumber 1"
            StringForListBox(2) = "Series 1 ScreenNumber 2"
            StringForListBox(3) = "Series 1 ScreenNumber 3"
            a = 1
            ListBoxDisplaySavedScreens.Items.Clear()
            Do Until StringForListBox(a) = ""
                ListBoxDisplaySavedScreens.Items.Add(StringForListBox(a))
                a += 1
            Loop
        End Sub
    I created an install program using InstallShield just like I did for the other and then installed it into XP and I don't see the black blocks. Don't know what the difference is. I had enable application framework disabled just like for the other application. I think I have all the properties matched between the 2 ListBoxes in the different applications. I'll go back over them.

    Here's a separate question. In the above Sub at the top of this post I manually empty an array out setting the separate elements to "". Is there a way to empty an array using some function that's built into Visual Basic 2010?
    Last edited by EntityX; Jul 28th, 2011 at 05:07 PM.
    Make as many mistakes as you can as quickly as you can. We want to make sure that we make a great enough number of mistakes in a given amount of time so that we can be successful.

    "Persistence is the magic of success." Paramahansa Yogananda

  5. #5
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    26,422

    Re: Getting black blocks after Item entry in ListBox if Windows XP is being used

    Code:
    StringForListBox(a) = "Series " & Series & " ScreenNumber " & adec & R
    what is R?

  6. #6

    Thread Starter
    Fanatic Member EntityX's Avatar
    Join Date
    Feb 2007
    Location
    Omnipresence
    Posts
    798

    Re: Getting black blocks after Item entry in ListBox if Windows XP is being used

    I just saw your post # 3 after I made post number 4.

    Code:
    Public R As String = Environment.NewLine
    After I read post # 3 I realized I didn't do a good test in my test application I just created. I should have included R in the strings but I didn't. I'll do another test with R.
    Make as many mistakes as you can as quickly as you can. We want to make sure that we make a great enough number of mistakes in a given amount of time so that we can be successful.

    "Persistence is the magic of success." Paramahansa Yogananda

  7. #7
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    26,422

    Re: Getting black blocks after Item entry in ListBox if Windows XP is being used

    that will be the problem then. just rebuild without the Environment.NewLine's

  8. #8

    Thread Starter
    Fanatic Member EntityX's Avatar
    Join Date
    Feb 2007
    Location
    Omnipresence
    Posts
    798

    Re: Getting black blocks after Item entry in ListBox if Windows XP is being used

    Each string is a separate item in the ListBox so they aren't necessary at all. My first test application proved that. I redid the test application with R and this is what it looked like in XP. It's a larger font so you can see better what it looks like. When you said rebuild without Environment.NewLine, I thought about it and see that they were never necessary.
    Attached Images Attached Images  
    Make as many mistakes as you can as quickly as you can. We want to make sure that we make a great enough number of mistakes in a given amount of time so that we can be successful.

    "Persistence is the magic of success." Paramahansa Yogananda

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