private void button_zmenit_vel_tridy_Click(object sender, EventArgs e) { if (this.dataGridView1.SelectedRows.Count == 0) { MessageBox.Show("Nejprve vyber řádek"); return; } int index = this.dataGridView1.SelectedRows[0].Index; // Create a new instance of the Form2 class Form_Predmet1 Form = new Form_Predmet1(this); // Show the settings form Form.Show(); Form.Init( (int)this.dataGridView1.SelectedRows[0].Cells[0].Value, this.dataGridView1.SelectedRows[0].Cells[1].Value.ToString(), this.dataGridView1.SelectedRows[0].Cells[2].Value.ToString(), this.dataGridView1.SelectedRows[0].Cells[3].Value.ToString(), this.dataGridView1.SelectedRows[0].Cells[4].Value.ToString(), this.dataGridView1.SelectedRows[0].Cells[5].Value.ToString(), this.dataGridView1.SelectedRows[0].Cells[6].Value.ToString(), this.dataGridView1.SelectedRows[0].Cells[7].Value.ToString(), this.dataGridView1.SelectedRows[0].Cells[8].Value.ToString(), this.dataGridView1.SelectedRows[0].Cells[9].Value.ToString(), this.dataGridView1.SelectedRows[0].Cells[10].Value.ToString() ); }
private void button1_Click(object sender, EventArgs e) { // Create a new instance of the Form2 class Form_Predmet1 settingsForm = new Form_Predmet1(this); // Show the settings form settingsForm.Show(); }