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 btnDelete_Click(object sender, EventArgs e) { Message.ConfirmForm confirmForm = new Message.ConfirmForm("確認要刪除該筆紀錄嗎?"); formFunction.OpenFocusForm(confirmForm); /*-- 確認要刪除 --*/ if (confirmForm.isOk) { DeleteLog(contactNum, tableName); ShowAllAskingLog(contactNum); //顯示DataGridView的內容 /*- 禁用按鈕 -*/ OftenUseColor.ButtonDisable(btnCompleteContent); OftenUseColor.ButtonDisable(btnDelete); } }
/*--- 啟用 修改、刪除 ---*/ private void EnEditBtn() { OftenUseColor.ButtonEnable(btnModify); //啟用修改按鈕 OftenUseColor.ButtonEnable(btnDelete); //啟用刪除按鈕 }
/*--- txtInput 提示狀態 ---*/ private void txtInput_Leave(object sender, EventArgs e) { OftenUseColor.SetPromptTextStatus(txtInput, "輸入地點"); }
/*------ Other *-『DisEditBtn』:禁用 修改、刪除 *-『EnEditBtn』:啟用 修改、刪除 *-『placeView_ColumnHeaderMouseClick』:點擊檢視表標題欄時,不選取資料列 *--------------------------------------------------------------------------*/ /*--- 禁用 修改、刪除 ---*/ private void DisEditBtn() { OftenUseColor.ButtonDisable(btnModify); //禁用修改按鈕 OftenUseColor.ButtonDisable(btnDelete); //禁用刪除按鈕 }
/*--- 禁用按鈕 『問事區』 ---*/ private void DisableBtn_askingTable() { OftenUseColor.ButtonDisable(btnEdit); OftenUseColor.ButtonDisable(btnDeleteLog); }
/*------ TextBox 『txtInput』 *-『txtInput_Enter』:輸入狀態 *-『txtInput_Leave』:提示狀態 *-『txtInput_KeyPress』:限制輸入 * -------------------------------------*/ /* txtInput 輸入狀態 */ private void txtInput_Enter(object sender, EventArgs e) { OftenUseColor.SetInputTextStatus(txtInput); }
/*--- 禁用編輯按鈕 ---*/ private void DisEditBtn() { OftenUseColor.ButtonDisable(btnCompleteData); OftenUseColor.ButtonDisable(btnDelete); }
/*------ TextBox『txtInput』 *-『txtInput_Enter』:輸入時的文字顏色 *-『txtInput_KeyPress』:限制輸入 *-------------------------------------------*/ /*--- 輸入時的文字顏色 ---*/ private void txtInput_Enter(object sender, EventArgs e) { msgNotNull.Visible = false; //隱藏『必須輸入』 OftenUseColor.SetInputTextStatus(txtInput); }
/*------ Other *-『EnEditBtn』:啟用編輯按鈕 *-『DisEditBtn』:禁用編輯按鈕 *------------------------------------*/ /*--- 啟用編輯按鈕 ---*/ private void EnEditBtn() { OftenUseColor.ButtonEnable(btnCompleteData); OftenUseColor.ButtonEnable(btnDelete); }
/*--- 輸入狀態 ---*/ private void txtInput_Enter(object sender, EventArgs e) { inWarningMsg.Visible = false; //隱藏『必須輸入內容,才能做查詢』 OftenUseColor.SetInputTextStatus(txtInput); }
/*--- 輸入狀態 ---*/ private void txtInContent_Enter(object sender, EventArgs e) { inWarningMsg.Visible = false; //隱藏錯誤訊息 OftenUseColor.SetInputTextStatus(txtInContent); }
/*--- 禁用按鈕 ---*/ private void DisableButton() { OftenUseColor.ButtonDisable(btnDelete); //禁用『刪除』按鈕 OftenUseColor.ButtonDisable(btnComplete); //禁用『完整內容』按鈕 }
/*------ Other *-『EnableButton』:啟用按鈕 *-『DisableButton』:禁用按鈕 *------------------------------------*/ /*--- 啟用按鈕 ---*/ private void EnableButton() { OftenUseColor.ButtonEnable(btnDelete); //啟用『刪除』按鈕 OftenUseColor.ButtonEnable(btnComplete); //啟用『完整內容』按鈕 }