将文本框中的数据以一种形式放入另一种形式的列表视图中 [英] Putting data from a textbox in one form, into a listview in a different form

查看:101
本文介绍了将文本框中的数据以一种形式放入另一种形式的列表视图中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我在Visual Studio 2010中有一个窗体,该窗体必须准备好供用户输入的文本框,然后单击按钮(添加"),在两个文本框中键入的文本必须出现在另一个窗体上的列表视图中.

两种形式都已打开,但是单击添加"按钮后,需要关闭带有两个文本框的形式(我知道这只是一个"Me.close()"),并且两个项目都将关闭.出现在另一种形式的列表视图中.

另外,应该允许我使用相同的过程向列表视图添加任意多次.

非常感谢您的想法...
汤姆.

Hi everyone,

I have a form in Visual Studio 2010 that has to textboxes ready for user input, and on a button click ("Add"), the text that is typed in the two textboxes has to appear in a listview which is on a different form.

Both forms are open a this point, but once the "Add" button has been clicked, the form with the two textboxes needs to close (which I know will be just a "Me.close()"), and the two items will appear in the listview on the other form.

Also, I should be allowed to add as many times as I want to the listview using the same process.

Much appreciated for your thoughts...
Tom.

推荐答案

你好朋友
要存档,请按照以下步骤操作

1)第一种方法
1)U可以将修饰符属性更改为internal
2)并从第二种形式U以这种方式添加它

form1.listview.items.Add(textbox1.text)
hello friend
to archive this follow these steps

1) First Approach
1)U can change the modifiers property to internal
2) and from second form U add it in this manner

form1.listview.items.Add(textbox1.text)


这篇关于将文本框中的数据以一种形式放入另一种形式的列表视图中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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