如何使用2个表单向列表视图添加数据 [英] How Do I Add Data To List View Using 2 Forms
问题描述
1有一个表单,其中包含所有文本框和按钮,以将相应的字段添加到列表视图中。现在记住这一点,当我的listview和所有文本框和按钮在同一个表单上时,我能够将项目添加到listview中。
我想做的是我想用mylistview将项目添加到listview中在另一种形式和我的文本框和其他用于添加数据的东西在另一个。基本上将有2个表格
是否可以这样做?如果是,将如何为此编写代码。
是的 - 它并不复杂,但你最好创建事件并按此方式执行。
此处有关于C#流程的解释:传输信息在两个表格之间,第2部分:从孩子到父母 [ ^ ]您的文本框和按钮表单是子,列表视图位于父级。 VB的过程是一样的,但是语法稍有不同:事件(Visual Basic) [ ^ ]应该指导您完成。
1 have one form which contains all textbox and buttons to add the appropriate fields into list view. Now keeping this in mind, I am able to add items into listview when my listview and all textbox and buttons are on same form.
what i wanna do is that i want to add items into listview with mylistview in another form and my textboxes and other stuff used to add the data is on another.basically there will be 2 forms
is it possible to do that? if yes how will the code be written for this perticularily.
Yes - it's not complicated but you are best off creating events and doing it that way.
There is an explanation for the process for C# here: Transferring information between two forms, Part 2: Child to Parent[^] where your textbox-and-buttons form is the "child" and the list view is on the "parent". The process is the same fro VB, but teh syntax is slightly different: Events (Visual Basic)[^] should guide you through.
这篇关于如何使用2个表单向列表视图添加数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!