将字符串添加到列表框中.

问题描述:

大家好,

我在列表框中遇到了一个小问题.我对此没有任何解决办法.
问题是:

我需要在不打开任何其他窗口或输入值的控件的情况下将项目添加到列表框中.
只需当我双击列表框时,应打开一个可编辑的文本框,当我输入文本并单击Enter时,应将其添加到列表框.
我尝试了以下示例,但不适用于添加.可编辑多行列表框

有人可以帮我吗?...

谢谢
Harish Reddy

Hi all,

I''m facing a small problem in listbox. i didn''t get any solution for this.
Problem is:

I need to add item to the Listbox with out opening any other windows or control for entering the value.
simply when i double click on the listbox one editable text box should be open and when i entered the text and click enter it should add to the listbox.
i tried the following example but it doesn''t work for adding. Editable Multiline Listbox

Can anybody help me....

Thanks
Harish Reddy

可编辑列表框 [^ ]

C#中的可编辑列表框 [
Editable ListBox[^]

Editable ListBox in C#[^]


当然是文章代码确实可以进行添加",否则作者无法演示其操作.如果无法添加项目,则没有任何内容可以编辑,对吗?

如果您不喜欢本文作者提供的代码,则可以随时查看其工作原理,想法并自行实现.我在这里没有任何问题.

—SA
Of course article code does "work for adding", otherwise the author could not demonstrate its operation. If an item cannot be added, there would be nothing to edit, right?

If you don''t like the code provided by the author of this article, you can always look at how it works, get the idea and implement your own. I don''t see any question here.

—SA