Foxtable(狐表)用户栏目专家坐堂 → [求助]自定义函数问题


  共有1730人关注过本帖平板打印复制链接

主题:[求助]自定义函数问题

帅哥哟,离线,有人找我吗?
cqlwsam
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:五尾狐 帖子:1014 积分:7535 威望:0 精华:0 注册:2010/4/12 12:23:00
[求助]自定义函数问题  发帖心情 Post By:2015/12/8 8:26:00 [只看该作者]

在项目中自定义函数(控件控制),运行提醒错误,提示如截图。


图片点击可在新窗口打开查看此主题相关图片如下:360反馈意见截图16720406106126102.png
图片点击可在新窗口打开查看

自定义函数代码如下:

Dim FTB As WinForm.Table= Args(0)
Dim frm As WinForm.Form=args(1)
Dim tb As Table = FTB.Table
'Dim frm As  f
If tb.count=0 Then
    For Each c As WinForm.Control In frm.Controls
        If Typeof c Is winform.button Then
            c.Enabled=False
        End If
    Next
    frm.controls("Btn_add").Enabled=True
Else If tb.count=1 Then
    For Each c As WinForm.Control In frm.Controls
        If Typeof c Is winform.button Then
            c.Enabled=False
        End If
    Next
    frm.Controls("Btn_edit").Enabled=True
    frm.Controls("Btn_delete").Enabled=True
    frm.controls("Btn_add").Enabled=True
Else If tb.count>1 AndAlso tb.position=tb.count-1 Then
    For Each c As WinForm.Control In frm.Controls
        If Typeof c Is winform.button Then
            c.Enabled=True
        End If
    Next
    frm.Controls("Btn_last").enabled=False
    frm.Controls("Btn_next").enabled=False
    Frm.Controls("Btn_ok").enabled=False
    frm.Controls("Btn_cancel").enabled=False
Else If tb.count>1 AndAlso tb.position=0 Then
    For Each c As WinForm.Control In frm.Controls
        If Typeof c Is winform.button Then
            c.Enabled=True
        End If
    Next
    frm.Controls("Btn_first").enabled=False
    frm.Controls("Btn_pre").enabled=False
    frm.Controls("Btn_ok").enabled=False
    frm.Controls("Btn_cancel").enabled=False
Else
   For Each c As WinForm.Control In frm.Controls
       If Typeof c Is winform.button Then
           c.Enabled=True
       End If
   Next
   frm.Controls("Btn_ok").enabled=False
   frm.Controls("Btn_cancel").enabled=False
End If


 回到顶部