Visual Basic .Net列表框 [英] Visual Basic .Net List Box

查看:84
本文介绍了Visual Basic .Net列表框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在表单上遇到列表框问题。我有一个列表框,当

我向它添加项目时,文本没有显示在列表框中。我知道你的

已添加,因为侧滚动条改变了,我可以滚动浏览列表

框。我无法弄清楚为什么没有显示这些项目。我检查了背景颜色和文字颜色不同的
。请

让我知道还有什么可能是错的

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

推荐答案

你是否肯定你正在添加输入text对吗? listbox.items.add

方法接受类型对象因此,如果您尝试添加非文本内容的
,则不会产生错误。你能从你的

申请表中提供一些代码吗?


-Jason


" Hank1234" <哈****** @ discussions.microsoft.com>在留言中写道

news:00 ********************************** @ microsof t.com ...
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



向新闻组显示您拥有的代码&我们会看到你哪里出错了
Show the newsgroup the code you have & we''ll see where you are going wrong


这是我正在测试的代码。


Private Sub Button1_Click( ByVal sender As System.Object,ByVal e As

System.EventArgs)处理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"写道:
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:
你是否肯定你正在添加类型" text"对吗? listbox.items.add
方法接受类型对象。因此,如果您尝试添加非文本内容,则不会产生错误。你能提供一些来自你的
申请的代码吗?

-Jason

" Hank1234" <哈****** @ discussions.microsoft.com>在消息中写道
新闻:00 ********************************** @ microsof t.com。 ..
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




这篇关于Visual Basic .Net列表框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆