private void FrmActionDetail_Shown(object sender, EventArgs e) { try { this.bsIOActionSet.DataSource = ActionInfo; this.bsIOActionSet.ResetBindings(false); if (IsView) { txtActionID.ReadOnly = true; txtActionName.ReadOnly = true; txtDeviceID.ReadOnly = true; txtTerminalID.ReadOnly = true; cbxTerminalType.ReadOnly = true; cbxIOUseState.ReadOnly = true; txtTerminalData.ReadOnly = true; cbxIsPass.ReadOnly = true; txtWaitTime.ReadOnly = true; cbxIsWait.ReadOnly = true; btnClear.Enabled = false; btnSave.Enabled = false; } else { txtActionID.ReadOnly = false; txtActionName.ReadOnly = false; txtDeviceID.ReadOnly = false; txtTerminalID.ReadOnly = false; cbxTerminalType.ReadOnly = false; cbxIOUseState.ReadOnly = false; txtTerminalData.ReadOnly = false; cbxIsPass.ReadOnly = false; txtWaitTime.ReadOnly = false; cbxIsWait.ReadOnly = false; btnClear.Enabled = true; btnSave.Enabled = true; } this.bsIODevices.DataSource = AGVClientDAccess.LoadIODeviceInfo(); bsIODevices.ResetBindings(false); } catch (Exception ex) { MsgBox.ShowError(ex.Message); } }