以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  关于button控件“click”事件编程的问题  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=106257)

--  作者:mirochain1980
--  发布时间:2017/9/5 15:17:00
--  关于button控件“click”事件编程的问题

在一个窗口中放入了“button”,“click”事件代码为汇总,如下:

Dim t As Table = Tables("日记账")
Dim g As Subtotalgroup
t.SubtotalGroups.Clear()
t.GroupAboveData = False
t.TreeVisible = False
t.SpillNode = True

g = New Subtotalgroup
g.Aggregate = AggregateEnum.Sum
g.GroupOn = "日期"
g.TotalOn = "收入,支出"
g.Caption = "{0}年 累计"
g.DateGroup = DateGroupEnum.Year
g.upto = True
t.SubtotalGroups.Add(g)

g = New Subtotalgroup
g.Aggregate = AggregateEnum.Sum
g.GroupOn = "日期"
g.TotalOn = "收入,支出"
g.Caption = "{0}月 小计"
g.DateGroup = DateGroupEnum.Month
t.SubtotalGroups.Add(g)

t.Subtotal()

 

现在想,按一下这个钮汇总,再摁一下这个钮取消汇总,怎么弄?


--  作者:有点甜
--  发布时间:2017/9/5 15:30:00
--  
Dim t As Table = Tables("日记账")
If t.IsSubtotal Then
    t.ClearSubtotal
Else
    msgbox("汇总模式")
End If

--  作者:mirochain1980
--  发布时间:2017/9/5 15:53:00
--  
搞定了,谢谢!