private async void ButtonStart_Click(object sender, System.EventArgs e) { var progressReport = new Progress <int>(ReportCardProgress); TextBoxResult.Clear(); ProgressBarCards.Value = 0; PictureBoxLoding.Visible = true; // await Wait(); // var name = TextBoxInput.Text; var stopwatch = new Stopwatch(); try { // var greeting = await GetGreetings(name); // MessageBox.Show(greeting); var cards = await GetCards(1000); stopwatch.Start(); await ProcessCards(cards, progressReport); } catch (HttpRequestException ex) { MessageBox.Show(ex.Message); } MessageBox.Show($"Operation done in {stopwatch.ElapsedMilliseconds / 1000.0} seconds"); PictureBoxLoding.Visible = false; }
// NUMBERS -------------------------------------------------->> private void ButtonClick(object sender, EventArgs e) { // Clears '0' if there is any on the Text Screen if (TextBoxResult.Text == "0" || isOperationPerformed) { TextBoxResult.Clear(); } isOperationPerformed = false; // Gets the value of each button on to the text Screen Button button = (Button)sender; // Take care to only have ONE decimal (".") in the Text Screen if (button.Text == ".") { if (!TextBoxResult.Text.Contains(".")) { TextBoxResult.Text = TextBoxResult.Text + button.Text; } } else { TextBoxResult.Text = TextBoxResult.Text + button.Text; } }
private void ButtonCE_Click(object sender, EventArgs e) { if (!(TextBoxResult.Text.Contains(".")) && CheckIfTextBoxResultIsString()) { TextBoxResult.Text = "0"; return; } TextBoxResult.Clear(); TextBoxResult.Text = "0"; }
//Events for delete button (C , CE , DEL) private void ButtonC_Click(object sender, EventArgs e) {//Clear the Text box if (!(TextBoxResult.Text.Contains(".")) && CheckIfTextBoxResultIsString()) { TextBoxResult.Text = "0"; return; } TextBoxResult.Clear(); LabelHistory.Text = ""; TextBoxResult.Text = "0"; }
private void ButtonTask_Click(object sender, EventArgs e) { TextBoxResult.Clear(); var words = TextBoxSource.Text.Split(new[] { "\n" }, StringSplitOptions.RemoveEmptyEntries); var result = FormUtils.RunAlgorithm(words); foreach (var index in result) { TextBoxResult.AppendText(words[index] + '\n'); } }
private void HelperNumberButtonsToSetValue(string ValueToSet) { if (TextBoxResult.Text == "0") { TextBoxResult.Clear(); TextBoxResult.Text = ValueToSet; return; } if (!(TextBoxResult.Text.Contains(".")) && CheckIfTextBoxResultIsString()) { TextBoxResult.Text = "0"; return; } TextBoxResult.AppendText(ValueToSet); }
private void Button_Click(object sender, EventArgs e) { if ((TextBoxResult.Text == "0") || (IsOperationPerformed)) { TextBoxResult.Clear(); } IsOperationPerformed = false; Button button = (Button)sender; if (button.Text == ",") { if (!TextBoxResult.Text.Contains(",")) { TextBoxResult.Text = TextBoxResult.Text + button.Text; } } else { TextBoxResult.Text = TextBoxResult.Text + button.Text; } }
private void ButtonGetDataTable_OnClick(object sender, RoutedEventArgs e) { var result = _connectionManager.GetDataTable(TextBoxCommand.Text); TextBoxResult.Clear(); foreach (var x in result.Columns) { TextBoxResult.Text += x + "\t\t"; } TextBoxResult.Text += "\n"; foreach (DataRow x in result.Rows) { foreach (var cell in x.ItemArray) { TextBoxResult.Text += cell + "\t"; } TextBoxResult.Text += "\n"; } }
private void HelperActionsButtonsToSetValue(String ValueToSet) { if (LabelHistory.Text.Contains(ValueToSet)) { return; } if (TextBoxResult.Text.Remove(0, TextBoxResult.Text.Length - 1) == ".") { LabelHistory.Text = TextBoxResult.Text.Remove(TextBoxResult.Text.Length - 1) + ValueToSet; return; } if (!(TextBoxResult.Text.Contains(".")) && CheckIfTextBoxResultIsString()) { TextBoxResult.Clear(); TextBoxResult.Text = "0"; LabelHistory.Text = ""; return; } LabelHistory.Text = TextBoxResult.Text + ValueToSet; TextBoxResult.Text = "0"; }
private void button_1_Click(object sender, EventArgs e) { if ((TextBoxResult.Text == "0") || (isOperation)) { TextBoxResult.Clear(); } isOperation = false; Button button = (Button)sender; if (button.Text == ".") { if (!TextBoxResult.Text.Contains(".")) { TextBoxResult.Text = TextBoxResult.Text + button.Text; } } else { TextBoxResult.Text = TextBoxResult.Text + button.Text; } }
private void btnClear_Click(object sender, RoutedEventArgs e) { TextBoxResult.Clear(); }
private void clearAllToolStripMenuItem_Click(object sender, EventArgs e) { InputTextBox.Clear(); TextBoxResult.Clear(); }
/// <summary> /// Очистка текстовых полей. /// </summary> private void ClearTextBoxes() { TextBoxSource.Clear(); TextBoxResult.Clear(); }
/// <summary> /// Очищает поля формы /// </summary> public void ClearForm() { //TextBoxArg1.Clear(); //TextBoxArg2.Clear(); TextBoxResult.Clear(); }