private void button2_Click(object sender, EventArgs e) { EndDate_label.Hide(); Status_label.Hide(); Status_comboBox.Show(); dateTimePicker.Show(); dateTimePicker.Value = l.getEndDate(); Status_comboBox.Text = l.getStatus().ToString(); Save_button.Show(); dateTimePicker1.Show(); ReturnDate_label.Hide(); }
/// <summary> /// Update progress bar /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Client_DownloadProgressChanged(object sender, DownloadProgressChangedEventArgs e) { if (e.TotalBytesToReceive == -1) { Download_progressBar.Invoke((MethodInvoker)(() => { Download_progressBar.Style = ProgressBarStyle.Marquee; })); Status_label.Invoke((MethodInvoker)(() => { Status_label.Text = $"Downloading {SizeSuffix(e.BytesReceived)}..."; })); } else { Download_progressBar.Invoke((MethodInvoker)(() => { Download_progressBar.Style = ProgressBarStyle.Blocks; Download_progressBar.Value = e.ProgressPercentage; })); Status_label.Invoke((MethodInvoker)(() => { Status_label.Text = $"Downloading {SizeSuffix(e.BytesReceived)} from {SizeSuffix(e.TotalBytesToReceive)}..."; })); } }