For Each c As WinForm.Control In e.Form.Controls
If Typeof c Is WinForm.Button Then
Dim b As WinForm.Button = c
For Each dr As DataRow In DataTables("表B").DataRows '从数据表中提取数据
If dr IsNot Nothing Then
Dim dt1 As Date = dr("开始时间")
Dim dt2 As Date = dr("结束时间")
Dim tt As Date = Date.today
Dim nm As String = dr("姓名")
Dim lx As String = dr("缺勤类型")
If b.name = dr("姓名") Then
If tt>=dt1 AndAlso tt<=dt2 Then
b.text=lx
b.ImageFile=Nothing
End If
End If
End If
Next
End If
Next
[此贴子已经被作者于2015/8/2 21:27:44编辑过]