private void button10_Click_1(object sender, EventArgs e) { Admin_acc adc = new Admin_acc(); adc.Show(); adc.button1.Visible = false; adc.button2.Visible = false; adc.button3.Visible = true; if (power == "B") { adc.textB.Text = building; adc.textB.ReadOnly = true; } }
private void dgv1_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { string username = dataGridView1.Rows[e.RowIndex].Cells[0].Value.ToString(); string password = dataGridView1.Rows[e.RowIndex].Cells[1].Value.ToString(); if (building == "") { building = dataGridView1.Rows[e.RowIndex].Cells[2].Value.ToString(); } string power = dataGridView1.Rows[e.RowIndex].Cells[3].Value.ToString(); Admin_acc adc = new Admin_acc(); adc.Show(); adc.textU.Text = username; adc.username = username; adc.textP.Text = password; adc.textB.Text = building; adc.textB.ReadOnly = true; adc.textPR.Text = power; adc.button1.Visible = true; adc.button2.Visible = true; adc.button3.Visible = false; }