private void AddToList_btn_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(MassOfGrain_tbox.Text)) { MessageBox.Show("Enter a value for grain mass."); return; } if (string.IsNullOrEmpty(Description_tbox.Text)) { MessageBox.Show("Enter a grain description."); return; } var sb = new StringBuilder(); sb.Append(MassOfGrain_tbox.Text); sb.Append(" "); sb.Append(Description_tbox.Text); listBox1.Items.Add(sb); GrainTotal += Convert.ToDouble(MassOfGrain_tbox.Text); GrainTotal_tbox.Text = Convert.ToString(GrainTotal); MassOfGrain_tbox.Clear(); Description_tbox.Clear(); MassOfGrain_tbox.Focus(); }
private void Submit_btn_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(Description_tbox.Text)) { MessageBox.Show("Enter a yeast description."); return; } var sb = new StringBuilder(); sb.Append(YeastType_cbox.SelectedItem.ToString()); sb.Append(" "); sb.Append(Description_tbox.Text); Yeast_tbox.Text = Convert.ToString(sb); Description_tbox.Clear(); Yeast_tmp = Yeast_tbox.Text; }