private void button2_Click(object sender, EventArgs e) { مخزن_مستلزمات f = new مخزن_مستلزمات(); // f.Show(); if (f.ShowDialog() == DialogResult.OK) { textBox2.Text = مخزن_مستلزمات.Code.ToString(); textBox1.Text = مخزن_مستلزمات.Arabic_name; } }
private void dataGridView2_CellClick(object sender, DataGridViewCellEventArgs e) { try { if (e.ColumnIndex == 0 && e.RowIndex >= 0 && e.RowIndex != dataGridView2.Rows.Count) { مخزن_مستلزمات f = new مخزن_مستلزمات(); if (f.ShowDialog() == DialogResult.OK) { dataGridView2.Rows[e.RowIndex].Cells[1].Value = مخزن_مستلزمات.Code.ToString(); dataGridView2.Rows[e.RowIndex].Cells[2].Value = مخزن_مستلزمات.Arabic_name; } } } catch (Exception ex) { MessageBox.Show(ex.Message); } }