2010-08-24 61 views

回答

1

我得到了答案

 private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e) 
    { 
     string s = dataGridView1.CurrentCell.RowIndex.ToString(); 
     if (Convert.ToInt32(s) == 0) 
     { 
      Form f = new Form(); 
      ActivateMdiChild(f); 
      f.Show(); 
     } 
     if (Convert.ToInt32(s) == 1) 
     { 
      MessageBox.Show("Hi"); 
     } 
    } 
0

你需要在數據表(或隱藏的列)中保留一些要啓動的值標識表單。現在,在點擊事件中,您可以在當前行內查找該值並啓動所需的表單。

相關問題