问题如下: 选择Form1中要修改的值,点按钮呼出Form2,在Form2中修改其值. 实现的方法有很多.我觉得使用委托是最简单的. 代码如下:Form1 using System;using System.Drawing;using System.Collections;using System.ComponentModel;using System.Windows.Forms;using System.Data;namespace Test} 首先在Form1外面声明一个public delegate void UpdataList(string str) 委托名UpdataList 它所能关联的方法是没有返回值void能接受的参数为string类型. 然后button1按钮的Click事件将实例化Form2并将Form2中委托ul关联方法Updata(string s),此方法对ListBox中选择的值进行修改.Form2: using System;using System.Drawing;using System.Collections;using System.ComponentModel;using System.Windows.Forms;namespace Test 以上为所有实现代码.通过此例可以联想到许多地方都能用委托来简单实现.源码: /Files/wllyy189/Test.rar 相关文章: 2022-12-23 2022-12-23 2021-10-10 2021-09-22 2022-01-01 2021-06-01 2021-06-16 2022-01-14