Listbox Display problem

Posted on 2006-05-16
Last Modified: 2010-04-23
I have a Windows form which contains some buttons, a text box and a list box. One of the buttons causes the list box to be populated. When tested on 8 Win XP Pro computers(all with .Net Framework 1.1) at my customer's location half of the computers did not display the data that was added to the list box. Even though the individual lines on the list box were not visible, a vertical scroll bar did appear. Also I can highlight a line. I can tell where the items in the list box stop because I cannot hightlight beyond that point.  I added some code to the listbox_selectedIndexchanged event so that when I select a blank line, the contents of the line are displayed in the text box. All the data from the list box line is diplayed in the text box.
I have added Form.Refresh and Form.Listbox.refresh at various places. I have made the list box not visible and then visible again. But nothing I have tried makes the list box's text visible on those computers.
The other computers display the data without incident.
Any ideas?

Question by:mpdillon
    1 Comment
    LVL 1

    Accepted Solution

    I had a similar problem with a listview control. There were two causes to my problem. Maybe the solution will help or at least put you in the right direction:

    The first thing I was doing wrong was when I was clearing the control before loading new items, I was doing it wrong. My statement was "Listview1.Clear", when it should have been "Listview1.Items.Clear".

    The second thing that was wrong was the color scheme. By accident, my code was putting white text on a white background because of the Windows XP Theme I was using at the time.

    As I said, this may or may not help with your problem, but at least this will give you an idea of some things to look for when you get wierd problems like these.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    Suggested Solutions

    Title # Comments Views Activity
    Application to start topmost on windows 2 26
    Add row in datatable 18 43
    How to do in LINQ?? 18 45 check for multiple values 5 29
    I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
    Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now