在工具箱中找到dxValidationProvider控件拖拉到界面上,添加代码
ConditionValidationRule notEmptyValidationRule = new ConditionValidationRule(); notEmptyValidationRule.ConditionOperator = ConditionOperator.IsNotBlank; notEmptyValidationRule.ErrorText = "请输入 该表单不能为空!"; dxValidationProvider1.SetValidationRule(BulidName, notEmptyValidationRule);//两个参数表示验name值为BulidName的TextEdit控件为notEmptyValidationRule验证
原文:http://www.cnblogs.com/guxia/p/7583626.html