以文本方式查看主题

-  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=69148)

--  作者:fred
--  发布时间:2015/5/31 17:13:00
--  [求助]关于自动计算
如图
图片点击可在新窗口打开查看此主题相关图片如下:aggregate.jpg
图片点击可在新窗口打开查看

要实现自动计算的结果,显示在相应勾选的项后面的框中,怎么写“自动计算”中的CLICK事件?

当然是指当前选定区域。
[此贴子已经被作者于2015/5/31 17:15:25编辑过]

--  作者:大红袍
--  发布时间:2015/5/31 19:05:00
--  

参考代码

 

Dim t As Table = CurrentTable
msgbox("计数:" & t.Aggregate(AggregateEnum.Count, t.TopRow, t.LeftCol, t.BottomRow, t.RightCol))
msgbox("累计:" & t.Aggregate(AggregateEnum.Sum, t.TopRow, t.LeftCol, t.BottomRow, t.RightCol))
msgbox( "平均:" & t.Aggregate(AggregateEnum.Average, t.TopRow, t.LeftCol, t.BottomRow, t.RightCol))
msgbox("最大:" & t.Aggregate(AggregateEnum.Max, t.TopRow, t.LeftCol, t.BottomRow, t.RightCol))
msgbox("最小:" & t.Aggregate(AggregateEnum.Min, t.TopRow, t.LeftCol, t.BottomRow, t.RightCol))
msgbox("标准差:" & t.Aggregate(AggregateEnum.Std, t.TopRow, t.LeftCol, t.BottomRow, t.RightCol))
msgbox("总体标准差:" & t.Aggregate(AggregateEnum.StdPop, t.TopRow, t.LeftCol, t.BottomRow, t.RightCol))
msgbox("方差:" & t.Aggregate(AggregateEnum.Var, t.TopRow, t.LeftCol, t.BottomRow, t.RightCol))
msgbox("总体方差:" & t.Aggregate(AggregateEnum.VarPop, t.TopRow, t.LeftCol, t.BottomRow, t.RightCol))


--  作者:fred
--  发布时间:2015/6/1 15:49:00
--  
非常谢谢。其实,我是想勾选到哪个。点一下计算按钮后。结果显示在相应项后面的文本框中。不是用信息窗的方式一个一个出来。


--  作者:大红袍
--  发布时间:2015/6/1 16:01:00
--  

写一个,其余同理

 

Dim t As Table = CurrentTable

If e.Form.Controls("CheckBox1").Checked Then
    e.Form.Controls("TextBox1").Text = t.Aggregate(AggregateEnum.Count, t.TopRow, t.LeftCol, t.BottomRow, t.RightCol)   
Else   
    e.Form.Controls("TextBox1").Text = Nothing
End If

 


--  作者:fred
--  发布时间:2015/6/3 11:32:00
--  
感谢!
给我提供了一个方法。
我自己改一下。