public void UpdateGraph(string WaterFall = "") { thinking = true; stopwatch.Restart(); SP.Resize(pictureBox1.Width, pictureBox1.Height); SP.Clear(); SP.Grid(); if (WaterFall == "WaterFall") { SP.PlotSpot(Xs, Ys); } else { SP.PlotLine(Xs, Ys); } pictureBox1.BackgroundImage = SP.Render(); this.Refresh(); Application.DoEvents(); stopwatch.Stop(); MessageUpdate(); thinking = false; }