using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Forms;using System.Threading;namespace WindowsApplication1...{ public delegate void PrintHandler(object sender,string str,System.EventArgs e); //public event PrintHandler Print; public partial class Form1 : Form ...{ PrintStr MyPrint; public Form1() ...{ InitializeComponent(); MyPrint = new PrintStr(); MyPrint.Print +=new PrintHandler(this.MyPrint_Print); } private void button1_Click(object sender, EventArgs e) ...{ if (MyPrint!=null) ...{ MyPrint.CallPrint("dddd"); } } public void MyPrint_Print(object sender, string str, EventArgs e) ...{ this.label1.Text = str; } private void button2_Click(object sender, EventArgs e) ...{ Thread tidListen; if (MyPrint!=null) ...{ tidListen = new Thread(new ThreadStart(MyPrint.CallPrintt));//CallPrint("dddd") if (tidListen!=null) ...{ tidListen.Start(); } } } }/**//// <summary>/// ////////////////////////////////////////////////////////////////////////////////////////////////////// </summary> public class PrintStr ...{ public event PrintHandler Print; public void CallPrint(string str) ...{ System.EventArgs e =new EventArgs(); onPrint(e, str); } public void CallPrintt() ...{ System.EventArgs e = new EventArgs(); onPrint(e, "aaaaa"); } protected virtual void onPrint(EventArgs e,string str) ...{ if (Print!=null) ...{ Print(this, str, e); } } }}