public ProgressForm() { InitializeComponent(); this.OnCancelClick = () => { return true; }; Cancel += delegate() { Cancelled = true; }; Complete += new Action(ProgressForm_Ended); }