(c# + windows forms) Adding items to listBox in different class

后端 未结 3 1997
没有蜡笔的小新
没有蜡笔的小新 2021-01-22 05:00

I have two classes(forms), and I would like an item from class2 to be added to listBox in class1 when I click \"Accept\" button.

I

3条回答
  •  离开以前
    2021-01-22 05:49

    you created a new entity of type CarRental. what you should do is to send the first form to the second on construct, and modify things through that instance.

提交回复
热议问题