老师, 想要在ValidateEdit 判断是否符合正则,这块怎么写?
Dim r1 As Row
Dim fdr As Integer = Tables("分类编码方案").Findrow("基础档案名称 = '部门档案'")
If e.Col.Name = "编码名称" OrElse e.Col.Name = "编码规则" Then
If e.Text = "" OrElse e.text.Contains(" ") Then '如果已经输入内容
e.Cancel = True '则禁止退出编辑模式
Else
If fdr>0 Then
Dim r As Row=Tables("部门档案").Current
MessageBox.Show(r1("正则"))
Dim reg As new System.Text.RegularExpressions.Regex(r1("正则"))
If reg.Ismatch(e.Text) = False Then
e.Cancel = True
End If
End If
End If
End If
[此贴子已经被作者于2015/7/4 12:08:29编辑过]