DataGridView 셀을 두 번 클릭하면 어떻게 한 번 폼을 열 수 있습니까?DataGridView를 두 번 클릭하여 양식을 두 번 이상 열 수 없도록하려면 어떻게합니까?
private void dataGridView1_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e)
{
//string queryString = "SELECT id, thename, address,fax,mobile,email,website,notes FROM movie";
int currentRow = int.Parse(e.RowIndex.ToString());
try
{
string movieIDString = dataGridView1[0, currentRow].Value.ToString();
movieIDInt = int.Parse(movieIDString);
}
catch (Exception ex) { }
// edit button
if (e.RowIndex != -1)
{
string id = dataGridView1[0, currentRow].Value.ToString();
string thename = dataGridView1[1, currentRow].Value.ToString();
string address = dataGridView1[2, currentRow].Value.ToString();
string fax = dataGridView1[3, currentRow].Value.ToString();
string mobile = dataGridView1[4, currentRow].Value.ToString();
string email = dataGridView1[5, currentRow].Value.ToString();
string website = dataGridView1[6, currentRow].Value.ToString();
string notes = dataGridView1[7, currentRow].Value.ToString();
Form4 f4 = new Form4();
f4.id = movieIDInt;
f4.thename = thename;
f4.address = address;
f4.fax = fax;
f4.mobile = mobile;
f4.email = email;
f4.website = website;
f4.notes = notes;
f4.Show();
}
}
이 코드는 내가 열 경우 DoubleClick은 form.cs에서 글로벌 변수로 다시
Click 이벤트 처리기 또는 DoubleClick 이벤트 처리기 (또는 CellClick 또는 CellDoubleClick ...)에 게시 한 코드가 있습니까? – digEmAll
dataGridView1_CellMouseDoubleClick – amer