Possible bug in ListBox?

B

Ben Rush

I would find it very hard to believe that I'm seeing a bug in the listbox
control, as I'm sure it's one of the more popular controls out there. But I
simply do the following:

1) Create a new Windows Forms application (C#/VB.Net),
2) Drag and Drop a ListBox control onto my designer.
3) In the Form1_Load() event handler, simply add a "Hello World" to one of
the listbox items,
4) Run.....

But the text NEVER appears, however I can click where the text should be and
the region gets highlighted; so it's almost as if the text was white on a
white background, et al. I have been experiencing other such oddities where
icons added to ListView controls show up 32x32 black squares, etc. At first
I thought it might be an issue with my video driver, and so I asked others
at my company to do the same and everyone is experiencing the same issue
(three people so far). Another odd thing is that if the Form I'm using
happens to open up a secondary modal and I move the modal over the parent
window, the listbox starts displaying text again (so it seems like a refresh
issue).

This is the Form1.cs file that I'm using for my form - any insight would be
helpful (I have already tried reinstalling the 1.1 framework, upgrading my
video card drivers, and dropping hardware acceleration). My machine is a
Dell Inspiron 8200 running Windows XP Professional, GeForce 440 video card,
1 gig ram.....

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;

namespace TestingGroundsWindowCSharp
{
public class Form1 : System.Windows.Forms.Form
{
private System.Windows.Forms.ListBox listBox1;
private System.ComponentModel.Container components = null;

public Form1()
{
InitializeComponent();
}
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
private void InitializeComponent()
{
this.listBox1 = new System.Windows.Forms.ListBox();
this.SuspendLayout();

this.listBox1.Location = new System.Drawing.Point(112, 40);
this.listBox1.Name = "listBox1";
this.listBox1.Size = new System.Drawing.Size(240, 238);
this.listBox1.TabIndex = 0;

this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(472, 365);
this.Controls.Add(this.listBox1);
this.Name = "Form1";
this.Text = "Form1";
this.Load += new System.EventHandler(this.Form1_Load);
this.ResumeLayout(false);

}
[STAThread]
static void Main()
{
Application.Run(new Form1());
}

private void Form1_Load(object sender, System.EventArgs e)
{
this.listBox1.Items.Add("Hello World");
}
}
}
 
H

Herfried K. Wagner [MVP]

Ben Rush said:
I would find it very hard to believe that I'm seeing a bug in the listbox
control, as I'm sure it's one of the more popular controls out there. But I
simply do the following:

1) Create a new Windows Forms application (C#/VB.Net),
2) Drag and Drop a ListBox control onto my designer.
3) In the Form1_Load() event handler, simply add a "Hello World" to one of
the listbox items,
4) Run.....

But the text NEVER appears

Maybe this is caused by a McAfee VirusScan problem that NAI is aware of and
that can be fixed by installing a patch:

Patch 5 for McAfee VirusScan Enterprise 8.0i
<URL:https://knowledgemap.nai.com/phpclient/viewKDoc.aspx?url=kb/kb_kb38717.xml&docType=DOC_KnowledgeBase>
 
F

Frank Lynch

I'm having the same problem with an app that had been working. It
has happened on both XP and 2003 but still works on some XP
machines. My app has a dataset bound combo box and a list box both
of which exibit this problem. All of these machines have the
latest security patches installed on them. Although I'm not sure
about some of the GDI+ patches. I'm running all Dells. Sorry, I
don't have a fix for you but if we are both seeing this then it's
a bug, right. :) I'll let you know if I find a solution.
 
H

Herfried K. Wagner [MVP]

Frank,

Frank Lynch said:
I'm having the same problem with an app that had been working. It
has happened on both XP and 2003 but still works on some XP
machines. My app has a dataset bound combo box and a list box both
of which exibit this problem. All of these machines have the
latest security patches installed on them. Although I'm not sure
about some of the GDI+ patches. I'm running all Dells. Sorry, I
don't have a fix for you but if we are both seeing this then it's
a bug, right. :) I'll let you know if I find a solution.

For the case that you missed my reply to the OP:

---
Maybe this is caused by a McAfee VirusScan problem that NAI is aware of and
that can be fixed by installing a patch:

Patch 5 for McAfee VirusScan Enterprise 8.0i
<URL:https://knowledgemap.nai.com/phpclient/viewKDoc.aspx?url=kb/kb_kb38717.xml&docType=DOC_KnowledgeBase>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top