private void SetButtonText(String text) { if (this.cancelButton.InvokeRequired) { UpdateCancelButton d = new UpdateCancelButton(SetButtonText); this.Invoke(d, text); } else { this.cancelButton.Text = string.Format("Cancel ({0})", text); } }