public void ShowForm2() { // Declare my form Form2 a = new Form2(); // Show form a.Show(); } private void mnuSystem_Click(object sender, EventArgs e) { _StatusProgressBar.ProgressBar.Show(); // Method invoker MethodInvoker ink = new MethodInvoker(ShowForm2); IAsyncResult a = ink.BeginInvoke(null, null); _StatusProgressBar.ProgressBar.Value = 1; while (!a.IsCompleted) { if (_StatusProgressBar.ProgressBar.Value == 100) { _StatusProgressBar.ProgressBar.Value = 1; } else { _StatusProgressBar.ProgressBar.Value += 1; System.Threading.Thread.Sleep(10); } } ink.EndInvoke(a); _StatusProgressBar.ProgressBar.Hide(); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)