如何将表单中的listbox1中的项目传递到C#中的form2中的listbox2 [英] How to pass items from listbox1 in form1 to listbox2 in form2 in C#

查看:128
本文介绍了如何将表单中的listbox1中的项目传递到C#中的form2中的listbox2的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在form1中,我有多个文本框和两个按钮,一个用于显示listbox1中输入的文本框输入,另一个用于移动到form2。

在form2中我有一个按钮和一个名为listbox2的列表框。

我想知道当我点击时,如何将form1中listbox1中的项目传递给form2中的listbox2 form2中的按钮。



我尝试过:



我无法找到解决这个问题的方法。

解决方案

OriginalGriff发布了一系列提示,说明如何做到这一点:

在两个表格之间传递信息,第1部分:父母对孩子 [ ^ ]

在两个之间传输信息表格,第2部分:儿童到家长 [ ^ ]

在两种表格之间传递信息,第3部分:儿童与儿童 [< a href =https://www.codeproject.com/Tips/548160/Transferring-information-between-two-forms-Part-3target =_ blanktitle =New Window> ^ ]

In form1 I have more than one textbox and two buttons one that displays the entered inputs of textbox in listbox1 and one that moves to form2.
In form2 I have one button and one listbox that is called listbox2.
I want to know how to pass the items from listbox1 in form1 to listbox2 in form2 when I click the button that is in form2.

What I have tried:

I couldn't figure out a way to solve this problem.

解决方案

OriginalGriff has published a series of tips explaining how to do that:
Transferring information between two forms, Part 1: Parent to Child[^]
Transferring information between two forms, Part 2: Child to Parent[^]
Transferring information between two forms, Part 3: Child to Child[^]


这篇关于如何将表单中的listbox1中的项目传递到C#中的form2中的listbox2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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