ListBox Items not Visible

In windows form I just created a ListBox.

Added some items
ListBox1.Items.Add("Item-1");
ListBox1.Items.Add("Item-2");
and so on.

When I run it - these entries are not visible.
I just added a textBox and captured the ListBox1_SelectedIndexChanged event to put the Item's value to the TextBox.  The textBox is getting filled the correct data when I navigate in the ListBox.  It is just that the ListBox Items are not visible.  Looks  very strange to me.

Any ideas will be appreciated.

Thanks.
Sudha
getsudhaAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

volkingCommented:
Try adding "this." to every ListBox1 reference.
this.ListBox1.Items.Add("Item-1");
this.ListBox1.Items.Add("Item-2");

I assume you're adding the items during the Form.Load event, right?
0
AaronReamsCommented:
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
AaronReamsCommented:
Glad that fixed your problem.   Just in case the above link every breaks, here is the solution for all you future answer seekers...

<snip>
I recently installed McAfee 8 and the buffer overflow protection was the
culprit. Once disabled the messagebox behaved normally. Many thanks to
those who pointed this out.
</snip>
0
getsudhaAuthor Commented:
Yes that was it.  Thanks a lot for finding it.  
Buffer Overflow protection of mcAfee VirusScan Enterprise ver. 8.0i was the culprit.  I am going to post this to mcAfee, they can change the definition for Buffer OverFlow protection to avoid this.

Thanks.
Sudha
0
GivenRandyCommented:
This was supposedly fixed, but we keep updated with the latest versions (daily) and we still have this problem. The irritant is that most users cannot modify their Buffer Overflow Protection because they lack admin rights. Any idea when this will be fixed by McAfee?
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C#

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.