Foxtable(狐表)用户栏目专家坐堂 → [求助]窗口中有多个按钮,怎么通过表中的数据修改按钮的属性


  共有2688人关注过本帖树形打印复制链接

主题:[求助]窗口中有多个按钮,怎么通过表中的数据修改按钮的属性

帅哥,在线噢!
有点蓝
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:107721 积分:547938 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2015/8/2 21:22:00 [显示全部帖子]

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编辑过]

 回到顶部