IT淘沙者
用事件注册实现窗口之间传值
事件和数据定义:
1
using System;
2
using System.Collections.Generic;
3
using System.Text;
4
5
namespace WindowsApplication1
6
2
3
4
5
6
父窗体MainForm代码如下:
1
using System;
2
using System.Collections.Generic;
3
using System.ComponentModel;
4
using System.Data;
5
using System.Drawing;
6
using System.Text;
7
using System.Windows.Forms;
8
9
namespace WindowsApplication1
10
}
2
3
4
5
6
7
8
9
10
子窗体SForm1代码(SForm2的代码和SForm1的代码相同):
1
using System;
2
using System.Collections.Generic;
3
using System.ComponentModel;
4
using System.Data;
5
using System.Drawing;
6
using System.Text;
7
using System.Windows.Forms;
8
9
namespace WindowsApplication1
10
}
2
3
4
5
6
7
8
9
10