private void GoButton_Click(object sender, EventArgs e) { if (!LatitudeTextIsCorrect() || !LongitudeTextIsCorrect() || !RadiusTextIsCorrect()) { MessageBox.Show("Please enter correct required data. Erroneus data is painted red."); } else { var currentProgressValue = 0; GoButton.Enabled = false; InitiateProgressBars(); UpdateProgressBars(currentProgressValue); var result = new BarDataModel(); CollectBarsFromProvider(new GetBarListGoogle(), result, GetLatitude(), GetLongitude(), GetRadius()); currentProgressValue += 25; UpdateProgressBars(currentProgressValue); CollectBarsFromProvider(new GetBarListFourSquare(), result, GetLatitude(), GetLongitude(), GetRadius()); currentProgressValue += 25; UpdateProgressBars(currentProgressValue); CollectBarsFromProvider(new GetBarListFacebook(), result, GetLatitude(), GetLongitude(), GetRadius()); currentProgressValue += 25; UpdateProgressBars(currentProgressValue); CollectBarsFromProvider(new GetBarListTripAdvisor(), result, GetLatitude(), GetLongitude(), GetRadius()); currentProgressValue += 25; UpdateProgressBars(currentProgressValue); HideProgressBars(); // Display result.GetRatings(); //_barRating = new BarRating(); _barRating.BarsData = result; //_barRating.AddBars(result.BarsList); _barRating.ResetLastCompare(); _lastSortColumnIndex = -1; SortList(CompareType.Distance); Application.DoEvents(); // no idea what this does. Some threading stuff, but makes button disabling work GoButton.Enabled = true; } }