以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  窗口CurrentChanged事件  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=127518)

--  作者:ZJZK2018
--  发布时间:2018/11/15 18:11:00
--  窗口CurrentChanged事件

窗口CurrentChanged事件中写入下面代码,为什么只执行红色部分代码?

 

If e.Table.Current Is Nothing Then \'如果Current为Nothing
    Return
Else
    \'\'\'显示或关闭菜单按钮
    For Each dr As Row In CurrentTable.Rows
        Dim sit As WinForm.StripItem = e.Form.Strips("主菜单").Items("txbf")
        Dim ns As Integer = DataTables("图像明细").Compute("Count([_Identify])","图像编号 = \'" & dr("附件编号") & "\'")
        If ns > 0 Then
            sit.Enabled = True
        Else
            sit.Enabled = False
            Return
        End If

       
        Dim pstr As WinForm.StripItem = e.Form.Strips("主菜单").Items("Pdf_open")
        Dim pfil As String = "文件名称 = \'" & dr("文件名称") & "\' And 文件附件编号 = \'" & dr("附件编号") & "\' And 文件后缀 = \'.pdf\'"
        Dim pcnt As Integer = DataTables("资料明细").Compute("Count([_Identify])",pfil)
        If pcnt > 0 Then
            pstr.Enabled = True
        Else
            pstr.Enabled = False
        End If
       
       
        Dim wstr As WinForm.StripItem = e.Form.Strips("主菜单").Items("Word_open")
        Dim wfil As String = "文件名称 = \'" & dr("文件名称") & "\' And 文件附件编号 = \'" & dr("附件编号") & "\' And 文件后缀 = \'.doc\'"
        Dim wcnt As Integer = DataTables("资料明细").Compute("Count([_Identify])",wfil)
        If wcnt > 0 Then
            wstr.Enabled = True
        Else
            wstr.Enabled = False
        End If
    Next
End If  

 

 

 


--  作者:y2287958
--  发布时间:2018/11/15 18:57:00
--  
If e.Table.Current Is Nothing Then \'如果Current为Nothing
    Return
End If
\'\'\'显示或关闭菜单按钮
For Each dr As Row In CurrentTable.Rows
    Dim sit As WinForm.StripItem = e.Form.Strips("主菜单").Items("txbf")
    Dim ns As Integer = DataTables("图像明细").Compute("Count([_Identify])","图像编号 = \'" & dr("附件编号") & "\'")
    sit.Enabled = ns > 0
    
    Dim pstr As WinForm.StripItem = e.Form.Strips("主菜单").Items("Pdf_open")
    Dim pfil As String = "文件名称 = \'" & dr("文件名称") & "\' And 文件附件编号 = \'" & dr("附件编号") & "\' And 文件后缀 = \'.pdf\'"
    Dim pcnt As Integer = DataTables("资料明细").Compute("Count([_Identify])",pfil)
    pstr.Enabled = pcnt > 0    
    
    Dim wstr As WinForm.StripItem = e.Form.Strips("主菜单").Items("Word_open")
    Dim wfil As String = "文件名称 = \'" & dr("文件名称") & "\' And 文件附件编号 = \'" & dr("附件编号") & "\' And 文件后缀 = \'.doc\'"
    Dim wcnt As Integer = DataTables("资料明细").Compute("Count([_Identify])",wfil)
    wstr.Enabled = wcnt > 0
Next

--  作者:有点甜
--  发布时间:2018/11/15 20:36:00
--  

1、把 Return 代码删除;

 

2、你的逻辑是什么?要达到什么目的?


--  作者:ZJZK2018
--  发布时间:2018/11/15 21:34:00
--  
谢谢,Return的问题