public void SetValueAndMsg(int setValue, string infoMsg) { SetInfoMsg(infoMsg); progressBar1.Value = setValue; this.Update(); if (progressBar1.Value >= progressBar1.Maximum) { this.Close(); this.Dispose(); } }