1. 程式人生 > >TextEdit不能空驗證設置

TextEdit不能空驗證設置

rule ror pty 參數表 兩個 lan not new span

在工具箱中找到dxValidationProvider控件拖拉到界面上,添加代碼

ConditionValidationRule notEmptyValidationRule = new ConditionValidationRule();
notEmptyValidationRule.ConditionOperator = ConditionOperator.IsNotBlank;
notEmptyValidationRule.ErrorText = "請輸入 該表單不能為空!";
dxValidationProvider1.SetValidationRule(BulidName, notEmptyValidationRule);
//兩個參數表示驗name值為BulidName的TextEdit控件為notEmptyValidationRule驗證

TextEdit不能空驗證設置