对于C#的事件,指代(Delegate)总是感觉理解不太深刻。这几天正好有机会学习了一下。从一个程序中改了一部分代码,实现了一个异步数据处理基本构架。 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 testManager ... { //progressbar窗体 //有一个cancel按钮,和一个进度条 public class ProgressForm : Form ...{ private System.ComponentModel.IContainer components = null; protected override void Dispose(bool disposing) ...{ if (disposing && (components != null)) ...{ components.Dispose(); } base.Dispose(disposing); } Windows InitializeComponent#region Windows InitializeComponent private void InitializeComponent() ...{ this.poProgressBar = new System.Windows.Forms.ProgressBar(); this.btnCancel = new System.Windows.Forms.Button(); this.SuspendLayout(); // // poProgressBar // this.poProgressBar.Location = new System.Drawing.Point(36, 24); this.poProgressBar.Name = "poProgressBar"; this.poProgressBar.Size = new System.Drawing.Size(398, 23); this.poProgressBar.Step = 1; this.poProgressBar.TabIndex = 0; // // btnCancel