Form2窗体中:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace 委托2
{
public partial class Form2 : Form
{
//声明带参数的委托
public delegate string strDelegate(string words);
//定义事件
public event strDelegate strEvent;
public Form2()
{
InitializeComponent();
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace 委托2
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}