我的窗體上有這個函數參數類型的函數:調用內部有另一個函數的C#
private void UpdateQuantityDataGridView(object sender, DataGridViewCellEventArgs e)
{
(...codes)
}
,我想調用另一個函數內部的功能,比方說,當我點擊了「確定」按鈕,以下函數將運行並執行具有參數類型的以上函數。
private void button5_Click(object sender, EventArgs e) // This is the "OK" button click handler.
{
SubmitButton(sender, e);
}
private void SubmitButton(object sender, EventArgs e) // This is function of "OK" button
{
(...codes)
UpdateQuantityDataGridView("What should i put in here? I tried (sender, e), but it is useless")
}
我知道,這個功能運行時,我們把這樣的事情: dataGridView1.CellValueChanged += new DataGridViewSystemEventHandler(...);
但是,我不希望這樣,因爲如果在DataGridView中的單元格值已更改的功能纔會運行,我想要訪問該功能,當我點擊「確定」按鈕。但是,我應該在參數值中放入什麼?
感謝先生@Karl安德森,我得到它現在:) – Kaoru