private async void button1_ClickAsync(object sender, EventArgs e) { try { var items = await GetApiItems.getItems(stock); textBox1.Text = items[index].Open.ToString(); textBox2.Text = items[index].High.ToString(); textBox3.Text = items[index].Low.ToString(); textBox4.Text = items[index].Close.ToString(); textBox6.Text = items[index].Volume.ToString(); } catch (Exception except) { MessageBox.Show(except.Message); } }
private async void button2_ClickAsync(object sender, EventArgs e) { stock = textStok.Text; //int numb = Convert.ToInt32(textBox5.Text); try { var items = await GetApiItems.getItems(stock); for (int i = 0; i < items.Count; i++) { DataComboBox1.Items.Add(items[i].Date); } } catch (Exception except) { MessageBox.Show("Incorect abbreviation"); } }