如何将列表框(隐藏)中的值访问到标签中。选择不工作因为它是隐藏的。 [英] How can you access a value in a listbox (Hidden) into a label. Select wont work cause it's hidden.

查看:67
本文介绍了如何将列表框(隐藏)中的值访问到标签中。选择不工作因为它是隐藏的。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,我是视觉工作室的新手,而且很敏锐。  我曾经在DOS日编程C#,对于我的孩子来说,没有什么特别的计划(教育)。  我正在编写一个拼写程序,用户在文本框中输入他/她的拼写单词
,当按下输入时,它存储在列表框中。  限制由用户输入的拼写单词数设置。完成列表框后,用户可以编辑任何错误。  我已经想出如何访问列表框,并删除,并且
重新插入更正的单词。  用户完成编辑后,将隐藏列表框。  我想要做的是将单词(一次一个)拉到标签中以显示拼写单词,当用户开始在文本框中键入单词时,
标签将被隐藏直到检查过程完成。  我搜索并搜索了论坛,但似乎所有这些都适合于无效的选择部分。  我认为您可以从索引中提取单词并显示它。有点像label1.text
= listbox1.items.index(mycount);  但这只是一个例子.. 

Hello all, I'm a newb with visual studio, and c sharp.  I used to program in C# back in the DOS day's nothing fancy just programs for my kids (Educational).  I'm currently writing a spelling program, that the user enters his/her spelling words in a textbox, and when pressing enter it's stored in a listbox.  The limit is set by the number of spelling words the user enters. When the listbox is done the user can edit any mistakes.  I've figured out how to access the listbox, and delete, and reinsert the corrected word.  When the user is done editing, The list box is hidden.  What I'm wanting to do is pull the words (one at a time) into a label to show the spelling word, and when the user starts typing the word in a textbox,  the label is hidden until the checking process is complete.  I've searched and searched the forums, but all seem geared to the select part which won't work.  I figured you'd be able to pull the word from an index, and display it. Kinda like label1.text = listbox1.items.index(mycount);  but that's just an example.. 

任何线索,都会非常感激。  此时我可能有隧道视觉。  我试图在用户输入数组时将它们分配给数组,但我在那里没有任何成功。  我知道它必须与范围,
我正在分配它们的方法有关。

Any clues, would be most appreciated.  I might be having tunnel vision at this point.  I've tried to assign them to an array when the user is entering them, but I'm not having any success there.  I know it must be something to do with scope, of the methods I'm assigning them in.

谢谢提前,

戴夫(慢乔)




推荐答案

hello joe ..我不明白为什么你不能用简单的 列表与LT; T> (在你的情况下列出< string>)你能告诉我们一些代码吗?


hello joe.. i don't see why can't you use a simple  List<T> (list<string> in your case) can you show us some code?


这篇关于如何将列表框(隐藏)中的值访问到标签中。选择不工作因为它是隐藏的。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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