By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,255 Members | 1,259 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,255 IT Pros & Developers. It's quick & easy.

Visual Basic .Net List Box

P: n/a
I am having a problem with a list box on a form. I have a list box that when
I add items to it the text does not show up in the list box. I know thy are
added because the side scroll bar changes and I can scrolll throught the list
box. I can not figure out why the items are not being displayed. I have
checked that the background color and the text color are different. Please
let me know what else could be wrong

Nov 21 '05 #1
Share this Question
Share on Google+
10 Replies


P: n/a
Are you positive you're adding type "text" to it? The listbox.items.add
method accepts a type "object" so it wouldn't produce an error if you tried
to add something that was not text. Could you provide some code from your
application?

-Jason

"Hank1234" <Ha******@discussions.microsoft.com> wrote in message
news:00**********************************@microsof t.com...
I am having a problem with a list box on a form. I have a list box that
when
I add items to it the text does not show up in the list box. I know thy
are
added because the side scroll bar changes and I can scrolll throught the
list
box. I can not figure out why the items are not being displayed. I have
checked that the background color and the text color are different. Please
let me know what else could be wrong

Nov 21 '05 #2

P: n/a
Show the newsgroup the code you have & we'll see where you are going wrong
Nov 21 '05 #3

P: n/a
Here is the code I was testing with.

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
ListBox1.Items.Add("HELLO")
ListBox1.Items.Add("HELLO")
ListBox1.Items.Add("HELLO")
ListBox1.Items.Add("HELLO")
ListBox1.Items.Add("HELLO")
ListBox1.Items.Add("HELLO")
ListBox1.Items.Add("HELLO")
ListBox1.Items.Add("HELLO")
ListBox1.Items.Add("HELLO")
ListBox1.Items.Add("HELLO")
ListBox1.Items.Add("HELLO")
ListBox1.Items.Add("HELLO")
ListBox1.Items.Add("HELLO")
End Sub

"OpticTygre" wrote:
Are you positive you're adding type "text" to it? The listbox.items.add
method accepts a type "object" so it wouldn't produce an error if you tried
to add something that was not text. Could you provide some code from your
application?

-Jason

"Hank1234" <Ha******@discussions.microsoft.com> wrote in message
news:00**********************************@microsof t.com...
I am having a problem with a list box on a form. I have a list box that
when
I add items to it the text does not show up in the list box. I know thy
are
added because the side scroll bar changes and I can scrolll throught the
list
box. I can not figure out why the items are not being displayed. I have
checked that the background color and the text color are different. Please
let me know what else could be wrong


Nov 21 '05 #4

P: n/a
Nothing wrong with that as far as I can see. Definately weird. If I think
of anything, I'll post back. I'm not sure if any kind of system font
changes or anything would affect it or not.

Try doing ListBox1.Items.Add(New String("Hello"))

That will most likely come up with the same result, but it's worth a shot.
Sorry I can't be of more help on this one.

-Jason

"Hank1234" <Ha******@discussions.microsoft.com> wrote in message
news:98**********************************@microsof t.com...
Here is the code I was testing with.

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
ListBox1.Items.Add("HELLO")
ListBox1.Items.Add("HELLO")
ListBox1.Items.Add("HELLO")
ListBox1.Items.Add("HELLO")
ListBox1.Items.Add("HELLO")
ListBox1.Items.Add("HELLO")
ListBox1.Items.Add("HELLO")
ListBox1.Items.Add("HELLO")
ListBox1.Items.Add("HELLO")
ListBox1.Items.Add("HELLO")
ListBox1.Items.Add("HELLO")
ListBox1.Items.Add("HELLO")
ListBox1.Items.Add("HELLO")
End Sub

"OpticTygre" wrote:
Are you positive you're adding type "text" to it? The listbox.items.add
method accepts a type "object" so it wouldn't produce an error if you
tried
to add something that was not text. Could you provide some code from
your
application?

-Jason

"Hank1234" <Ha******@discussions.microsoft.com> wrote in message
news:00**********************************@microsof t.com...
>I am having a problem with a list box on a form. I have a list box that
>when
> I add items to it the text does not show up in the list box. I know thy
> are
> added because the side scroll bar changes and I can scrolll throught
> the
> list
> box. I can not figure out why the items are not being displayed. I have
> checked that the background color and the text color are different.
> Please
> let me know what else could be wrong
>


Nov 21 '05 #5

P: n/a
"=?Utf-8?B?SGFuazEyMzQ=?=" <Ha******@discussions.microsoft.com> wrote in
news:98**********************************@microsof t.com:
Here is the code I was testing with.

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e
As
System.EventArgs) Handles Button1.Click
ListBox1.Items.Add("HELLO")
ListBox1.Items.Add("HELLO")
ListBox1.Items.Add("HELLO")
ListBox1.Items.Add("HELLO")
ListBox1.Items.Add("HELLO")
ListBox1.Items.Add("HELLO")
ListBox1.Items.Add("HELLO")
ListBox1.Items.Add("HELLO")
ListBox1.Items.Add("HELLO")
ListBox1.Items.Add("HELLO")
ListBox1.Items.Add("HELLO")
ListBox1.Items.Add("HELLO")
ListBox1.Items.Add("HELLO")
End Sub

"OpticTygre" wrote:
Are you positive you're adding type "text" to it? The
listbox.items.add method accepts a type "object" so it wouldn't
produce an error if you tried to add something that was not text.
Could you provide some code from your application?

-Jason

"Hank1234" <Ha******@discussions.microsoft.com> wrote in message
news:00**********************************@microsof t.com...
>I am having a problem with a list box on a form. I have a list box
>that when
> I add items to it the text does not show up in the list box. I know
> thy are
> added because the side scroll bar changes and I can scrolll
> throught the list
> box. I can not figure out why the items are not being displayed. I
> have checked that the background color and the text color are
> different. Please let me know what else could be wrong
>



The code is fine. If you've been playing with the properties, check to
make sure DrawMode is set to normal. Thats the only thing I can find
that produces those results (Scrollbars showing, but no text)

MP
Nov 21 '05 #6

P: n/a
"Hank1234" <Ha******@discussions.microsoft.com> schrieb:
I am having a problem with a list box on a form. I have a list box that
when
I add items to it the text does not show up in the list box. I know thy
are
added because the side scroll bar changes and I can scrolll throught the
list
box. I can not figure out why the items are not being displayed. I have
checked that the background color and the text color are different.


Maybe the problem is caused by an unpatched virus scanner. These symptoms
are typically 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>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #7

P: n/a
I have tried the "ListBox1.Items.Add(New String("Hello"))" code but it
produces the same result of no text but the scroll bars show up. I have also
checked the properties of the list box and the DrawMode is set to "Normal".
Even if I manually change the items (before runtime) it does the same thing.
Any other ideas?

"MeltingPoint" wrote:
"=?Utf-8?B?SGFuazEyMzQ=?=" <Ha******@discussions.microsoft.com> wrote in
news:98**********************************@microsof t.com:
Here is the code I was testing with.

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e
As
System.EventArgs) Handles Button1.Click
ListBox1.Items.Add("HELLO")
ListBox1.Items.Add("HELLO")
ListBox1.Items.Add("HELLO")
ListBox1.Items.Add("HELLO")
ListBox1.Items.Add("HELLO")
ListBox1.Items.Add("HELLO")
ListBox1.Items.Add("HELLO")
ListBox1.Items.Add("HELLO")
ListBox1.Items.Add("HELLO")
ListBox1.Items.Add("HELLO")
ListBox1.Items.Add("HELLO")
ListBox1.Items.Add("HELLO")
ListBox1.Items.Add("HELLO")
End Sub

"OpticTygre" wrote:
Are you positive you're adding type "text" to it? The
listbox.items.add method accepts a type "object" so it wouldn't
produce an error if you tried to add something that was not text.
Could you provide some code from your application?

-Jason

"Hank1234" <Ha******@discussions.microsoft.com> wrote in message
news:00**********************************@microsof t.com...
>I am having a problem with a list box on a form. I have a list box
>that when
> I add items to it the text does not show up in the list box. I know
> thy are
> added because the side scroll bar changes and I can scrolll
> throught the list
> box. I can not figure out why the items are not being displayed. I
> have checked that the background color and the text color are
> different. Please let me know what else could be wrong
>


The code is fine. If you've been playing with the properties, check to
make sure DrawMode is set to normal. Thats the only thing I can find
that produces those results (Scrollbars showing, but no text)

MP

Nov 21 '05 #8

P: n/a
Thank you for the link, we are running McAfee VirusScan Enterprise 8.0i
and it is fairly new to the enviroment. I will guess that this is the
problem and will see why we do not allready have this patch. Thanks again.

"Herfried K. Wagner [MVP]" wrote:
"Hank1234" <Ha******@discussions.microsoft.com> schrieb:
I am having a problem with a list box on a form. I have a list box that
when
I add items to it the text does not show up in the list box. I know thy
are
added because the side scroll bar changes and I can scrolll throught the
list
box. I can not figure out why the items are not being displayed. I have
checked that the background color and the text color are different.


Maybe the problem is caused by an unpatched virus scanner. These symptoms
are typically 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>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #9

P: n/a
Did you try removing the listbox from the form & then adding a new one. It
will keep the same default name, so, you won't need to alter your code. Does
that make any difference?

McAfee lets viruses through.. Symantec Antivirus 9.0 Corporate Edition is
far better!!
Nov 21 '05 #10

P: n/a
The patch has solved the problem, thanks again.

"Herfried K. Wagner [MVP]" wrote:
"Hank1234" <Ha******@discussions.microsoft.com> schrieb:
I am having a problem with a list box on a form. I have a list box that
when
I add items to it the text does not show up in the list box. I know thy
are
added because the side scroll bar changes and I can scrolll throught the
list
box. I can not figure out why the items are not being displayed. I have
checked that the background color and the text color are different.


Maybe the problem is caused by an unpatched virus scanner. These symptoms
are typically 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>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #11

This discussion thread is closed

Replies have been disabled for this discussion.