public static void AddObject() { AddHouse addHouse = new AddHouse(); if (addHouse.ShowDialog() == DialogResult.OK) { addHouse.ShowDialog(); } }
private void DataGridView1_CellMouseDoubleClick(Object sender, DataGridViewCellMouseEventArgs e) { AddHouse house = new AddHouse(); try { house.textBox1.Text = this.dataGridView1.CurrentRow.Cells[0].Value.ToString(); house.textBox2.Text = this.dataGridView1.CurrentRow.Cells[1].Value.ToString(); house.textBox3.Text = this.dataGridView1.CurrentRow.Cells[2].Value.ToString(); house.textBox4.Text = this.dataGridView1.CurrentRow.Cells[3].Value.ToString(); house.textBox5.Text = this.dataGridView1.CurrentRow.Cells[4].Value.ToString(); house.textBox6.Text = this.dataGridView1.CurrentRow.Cells[5].Value.ToString(); house.textBox7.Text = this.dataGridView1.CurrentRow.Cells[6].Value.ToString(); house.textBox8.Text = this.dataGridView1.CurrentRow.Cells[7].Value.ToString(); house.textBox9.Text = this.dataGridView1.CurrentRow.Cells[8].Value.ToString(); house.ShowDialog(); } catch (Exception ex) { MessageBox.Show(ex.Message.ToString(), ex.Source.ToString(), MessageBoxButtons.OK); } }
public void AddForm() { AddHouse f2 = new AddHouse(); f2.Show(); }