static void btnCancel_Click(object sender, EventArgs e) { if (_waitForm.InvokeRequired) { _waitForm.BeginInvoke(new EventHandler(btnCancel_Click), new object[] { e }); } else { if (OnCancel != null) { OnCancel.Invoke(); } } }