protected void HideSpinner() { if (picSpinner.InvokeRequired) { //Invoke the SetDataSource method on the UI thread var d = new SetHideSpinnerCallback(HideSpinner); Invoke(d); } else { picSpinner.Hide(); } }
protected void ShowSpinner() { if (picSpinner.InvokeRequired) { //Invoke the SetDataSource method on the UI thread var d = new SetHideSpinnerCallback(HideSpinner); Invoke(d, new object()); } else { picSpinner.BringToFront(); picSpinner.Show(); } }