public static void NextStep() { CurrentStepNumber++; double val = 100 / (End - Start) * Step * CurrentStepNumber; win.SetProgressValue(val); }