diff --git a/SanPinPLM/相关操作/4.0-other/999.Delphi脚本记录.md b/SanPinPLM/相关操作/4.0-other/999.Delphi脚本记录.md index c35d32af..6bd8790c 100644 --- a/SanPinPLM/相关操作/4.0-other/999.Delphi脚本记录.md +++ b/SanPinPLM/相关操作/4.0-other/999.Delphi脚本记录.md @@ -160,4 +160,33 @@ begin ShowMessage('操作失败: ' + E.Message); end; end. +``` + +## 更新是否控件 + + + +```Delphi +uses MyClass,Variables,BaseUtil,CommonFunc,DataConst,CFFrm,CFSimplePropFrm,Forms,StdCtrls,Variants,SysUtils,Classes,Controls,Dialogs, + CHostIntf,ProductClas,DocClas,LoginClas,VirtualTrees,CEntClas,PathClas; + +begin + try + // 校验逻辑:当 cbxusr_333 未选中时,强制 cbxusr_444 也未选中 + if not cbxusr_333.Checked then + begin + // 如果 cbxusr_444 当前是选中状态,则强制取消选中 + if cbxusr_444.Checked then + begin + cbxusr_444.Checked := False; + + // 可选:显示提示信息 + ShowMessage('已自动将444设为未选中状态,因为333未选中'); + end; + end; + except + on E: Exception do + ShowMessage('执行脚本时出错: ' + E.Message); + end; +end. ``` \ No newline at end of file