public static void StartSplash(bool showProgress, bool supportCancellation, string text, Action action) { if (f == null) { sp = new SplashControl(); sp.backgroundWorker1.ProgressChanged += new ProgressChangedEventHandler(SplashControl_ProgressChanged); sp.Dock = DockStyle.Fill; f = new SplashForm(); f.ClientSize = sp.Size; f.Controls.Add(sp); } sp.progressBarX1.Value = 0; sp.ShowProgress = showProgress; sp.SupportCancellation = supportCancellation; sp.Text = text; sp.backgroundWorker1.RunWorkerAsync(action); f.ShowDialog(); if (sp.innerException != null) throw sp.innerException; }
public static void SetProgressParams(int min, int max,bool showProgressBarPercent) { if (f == null) { sp = new SplashControl(); sp.Dock = DockStyle.Fill; f = new SplashForm(); f.ClientSize = sp.Size; f.Controls.Add(sp); } sp.progressBarX1.Minimum = min; sp.progressBarX1.Maximum = max; sp.progressBarX1.TextVisible = showProgressBarPercent; }