Foxtable(狐表)用户栏目专家坐堂 → 请教杂项中自动计算的代码如何写?


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

主题:请教杂项中自动计算的代码如何写?

美女呀,离线,留言给我吧!
yangming
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信 一级勋章
等级:超级版主 帖子:4109 积分:23338 威望:0 精华:21 注册:2008/9/1 20:07:00
  发帖心情 Post By:2011/8/31 9:34:00 [只看该作者]

http://www.foxtable.com/help/topics/0545.htm

示例二

 

你是问的菜单中的自动计算吧?

在菜单的系统事件:AfterSelRangeChange中的代码

Dim t As Table
RibbonMenu.StatusBar.Message3 = ""
Vars("SysUpdateAggregate") = False
If e.Table IsNot CurrentTable OrElse CurrentTable Is Nothing Then
    Return
Else
    t = CurrentTable
End If
If t.TopRow = t.BottomRow AndAlso t.LeftCol = t.RightCol Then
    Return
End If
For c As Integer = t.LeftCol To t.RightCol
    If c < 1 Then
        Continue For
    End If
    If t.Cols(c).IsNumeric = False Then
        Return
    End If
Next
Vars("SysUpdateAggregate") =  True

 

然后再在各选项中的代码,比如自动计算中的代码:

RaiseSystemEvent(CurrentTable,SystemEventTypeEnum.AfterSelRangeChange)

[此贴子已经被作者于2011-8-31 9:53:56编辑过]

 回到顶部
总数 11 1 2 下一页