public List<string> Item = new List<string>();
private void button2_Click(object sender, EventArgs e) { sett_Post_ProvinceBindingSource.Filter = "Province like '%" + textBox1.Text + "%'"; }
private void button1_Click(object sender, EventArgs e) { for (int i = 0; i < sett_Post_ProvinceDataGridView.RowCount; i++) { if (sett_Post_ProvinceDataGridView[0, i].Value != null && (Boolean)sett_Post_ProvinceDataGridView[0, i].Value == true) { Item.Add(sett_Post_ProvinceDataGridView[2, i].Value.ToString()); } } Close(); }
private void button1_Click(object sender, EventArgs e) { Form6 f = new Form6(); f.ShowDialog(); if (f.Item.Count > 0) { foreach (string str in f.Item) { textBox1.Text += Environment.NewLine + str; } } }