DataColChanged事件
If e.DataCol.Name = "身份证号码" Then If e.NewValue > "" Then e.DataRow("性别") = ReadSex(StrToNarrow(e.NewValue)) Dim y,m,d As Integer DateYMD(ReadBirthDay(StrToNarrow(e.NewValue)),Date.Today,y,m,d) e.DataRow("年龄") = y End IfEnd If