/*******************************************************************************************************/ #region PRIVATE METHODS private void changeFormMode() { //reset button colors btnSearch.ForeColor = MODEBUTTON_COLOR_DEFAULT; btnAdd.ForeColor = MODEBUTTON_COLOR_DEFAULT; btnUpdate.ForeColor = MODEBUTTON_COLOR_DEFAULT; switch (_mode) { case FormMode.Search: btnSubmit.Text = BUTTONTEXT_SUBMIT_SEARCH; btnCancel.Visible = false; btnSearch.ForeColor = MODEBUTTON_COLOR_ACTIVE; updateGridviewColumnToDisable(_inputToDisableOnUpdate, true, false); updateGridviewColumnToDisable(_inputToDisableOnSearch, false, true); break; case FormMode.New: btnSubmit.Text = BUTTONTEXT_SUBMIT_NEW; btnCancel.Visible = true; btnAdd.ForeColor = MODEBUTTON_COLOR_ACTIVE; updateGridviewColumnToDisable(_inputToDisableOnSearch, true, false); updateGridviewColumnToDisable(_inputToDisableOnUpdate, true, false); break; case FormMode.Update: btnSubmit.Text = BUTTONTEXT_SUBMIT_UPDATE; btnCancel.Visible = true; btnUpdate.ForeColor = MODEBUTTON_COLOR_ACTIVE; updateGridviewColumnToDisable(_inputToDisableOnSearch, true, false); updateGridviewColumnToDisable(_inputToDisableOnUpdate, false, false); break; } updateModeButtonsAvailabilityForGridRow(); arrangeInputPanelsAndResizeForm(); Tools.rearrangeButtonPanel(pnlActionButtons, HorizontalAlignment.Center); focusFirstInputPanel(); }