private void personalInfoView_CellClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex >= 0) { selectedIndex = e.RowIndex; // 啟用確認按鈕 OftenUseColor.ButtonEnable(btnConfirm); } }
/*--- 取得資料列的資料 ---*/ private void historiesView_CellClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex >= 0) { /*- 取得問事表名稱 -*/ tableName = historiesView.Rows[e.RowIndex].Cells[1].Value.ToString(); /*- 取得紀錄事項 -*/ content = historiesView.Rows[e.RowIndex].Cells[2].Value.ToString(); /*- 取得備註 -*/ remarks = historiesView.Rows[e.RowIndex].Cells[3].Value.ToString(); /*- 啟用按鈕 -*/ OftenUseColor.ButtonEnable(btnCompleteContent); OftenUseColor.ButtonEnable(btnDelete); } }
/*--- 啟用 修改、刪除 ---*/ private void EnEditBtn() { OftenUseColor.ButtonEnable(btnModify); //啟用修改按鈕 OftenUseColor.ButtonEnable(btnDelete); //啟用刪除按鈕 }
/*--- 啟用按鈕『問事區』 ---*/ private void EnableBtn_askingTable() { OftenUseColor.ButtonEnable(btnEdit); OftenUseColor.ButtonEnable(btnDeleteLog); }
/*------ Other *-『EnEditBtn』:啟用編輯按鈕 *-『DisEditBtn』:禁用編輯按鈕 *------------------------------------*/ /*--- 啟用編輯按鈕 ---*/ private void EnEditBtn() { OftenUseColor.ButtonEnable(btnCompleteData); OftenUseColor.ButtonEnable(btnDelete); }
/*------ Other *-『EnableButton』:啟用按鈕 *-『DisableButton』:禁用按鈕 *------------------------------------*/ /*--- 啟用按鈕 ---*/ private void EnableButton() { OftenUseColor.ButtonEnable(btnDelete); //啟用『刪除』按鈕 OftenUseColor.ButtonEnable(btnComplete); //啟用『完整內容』按鈕 }