以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  [求助]  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=121691)

--  作者:沪上游客
--  发布时间:2018/7/11 17:16:00
--  [求助]
Dim t As Table = Tables("我的工作台")
t.sort = "申请日期"
Dim n As Integer = t.Rows.count
Dim lbl As WinForm.Label
Dim lb2 As WinForm.Label
lb2 = e.Form.Controls("Label2")
lb2.Text = "您的待办事项有" & n & "条"
If n = 0 Then
    e.Form.Controls("Label1").Visible = True
    lbl = e.Form.Controls("Label1")
    lbl.Text = "没有数据"
Else
    e.Form.Controls("Label1").Visible = False
End If

老师你好!以上这段代码是在本窗口中按钮设置的,如果我要设置计划管理中,代码应该怎么写?
主要是这个代码  lb2 = e.Form.Controls("Label2")  应该怎么指定窗口?
谢谢老师!


--  作者:有点甜
--  发布时间:2018/7/11 18:13:00
--  
Dim frm As WinForm.Form = Forms("窗口1")
If frm.opened Then
    Dim t As Table = Tables("我的工作台")
    t.sort = "申请日期"
    Dim n As Integer = t.Rows.count
    Dim lbl As WinForm.Label
    Dim lb2 As WinForm.Label
    lb2 = frm.Controls("Label2")
    lb2.Text = "您的待办事项有" & n & "条"
    If n = 0 Then
        frm.Controls("Label1").Visible = True
        lbl = frm.Controls("Label1")
        lbl.Text = "没有数据"
    Else
        frm.Controls("Label1").Visible = False
    End If
End If

--  作者:沪上游客
--  发布时间:2018/7/11 18:36:00
--  
谢谢老师!已解决。