async void runExport(string l, string n) { LoadingCircle lo = new LoadingCircle(); lo.Show(); lo.BringToFront(); lo.TopMost = true; Panel pnl = new Panel(); this.Controls.Add(pnl); pnl.BackColor = this.BackColor; pnl.Size = this.Size; pnl.Location = new Point(0, 0); pnl.BringToFront(); string text = this.Text; this.Text = ""; this.Visible = false; await Task.Run(() => export(l, n)); try { this.Visible = true; this.Text = text; Controls.Remove(pnl); lo.Close(); } catch (Exception) { try { lo.Close(); } catch (Exception) { } } }
async void vulSpeciefiekerOpNaam(string Vnaam, string Anaam) { if (string.IsNullOrWhiteSpace(txtVNaam.Text)) { MessageBox.Show("Geef een geldige voornaam in."); } else if (string.IsNullOrWhiteSpace(txtANaam.Text)) { MessageBox.Show("Geef een geldige achternaam in."); } else { LoadingCircle lo = new LoadingCircle(); lo.Show(); lo.BringToFront(); lo.TopMost = true; Panel pnl = new Panel(); this.Controls.Add(pnl); pnl.BackColor = this.BackColor; pnl.Size = this.Size; pnl.Location = new Point(0, 0); pnl.BringToFront(); string text = this.Text; this.Text = ""; this.Visible = false; await Task.Run(() => _vulSpeciefiekerOpNaam(Vnaam, Anaam)); this.Visible = true; this.Text = text; Controls.Remove(pnl); lo.Close(); } }
public async void refreshLLN() { lo = new LoadingCircle(); lo.Show(); lo.BringToFront(); Panel pnl = new Panel(); this.Controls.Add(pnl); pnl.BackColor = this.BackColor; pnl.Size = this.Size; pnl.Location = new Point(0, 0); pnl.BringToFront(); string text = this.Text; this.Text = ""; this.Visible = false; lo.Focus(); await Task.Run(() => getAlleLLN()); this.Focus(); this.Visible = true; this.Text = text; Controls.Remove(pnl); lo.Close(); lo.Dispose(); }
public async void start() { lo = new LoadingCircle(); lo.Show(); lo.Focus(); lo.TopMost = true; lo.BringToFront(); await Task.Run(() => _start()); lo.Close(); }
async void refreshSpecifieker() { if (!busy) { if (Convert.ToDateTime(DateTime.ParseExact(dtpVan.Value.ToString("dd/MM/yyyy"), "dd/MM/yyyy", null)) > Convert.ToDateTime(DateTime.ParseExact(dtpTot.Value.ToString("dd/MM/yyyy"), "dd/MM/yyyy", null))) { busy = true; MessageBox.Show("De einddatum kan niet lager zijn dan de begindatum."); dtpVan.Value = DateTime.Now; busy = false; refreshSpecifieker(); } else if (Convert.ToDateTime(DateTime.ParseExact(dtpVan.Value.ToString("dd/MM/yyyy"), "dd/MM/yyyy", null)) > DateTime.Now) { busy = true; MessageBox.Show("Je kan niet in de toekomst beignnen zoeken."); dtpVan.Value = DateTime.Now; busy = false; refreshSpecifieker(); } else if (Convert.ToDateTime(DateTime.ParseExact(dtpTot.Value.ToString("dd/MM/yyyy"), "dd/MM/yyyy", null)) > DateTime.Now) { busy = true; MessageBox.Show("Je kan niet tot in de toekomst zoeken."); dtpTot.Value = DateTime.Now; busy = false; refreshSpecifieker(); } else { LoadingCircle lo = new LoadingCircle(); lo.Show(); lo.BringToFront(); lo.TopMost = true; Panel pnl = new Panel(); this.Controls.Add(pnl); pnl.BackColor = this.BackColor; pnl.Size = this.Size; pnl.Location = new Point(0, 0); pnl.BringToFront(); string text = this.Text; this.Text = ""; this.Visible = false; await Task.Run(() => refrSpecifieker()); this.Visible = true; this.Text = text; Controls.Remove(pnl); lo.Close(); } } }