Dim t As Table = CurrentTable
If t.Current Is Nothing Then
Return
End If
If SystemMenu = False AndAlso t.Cols(t.Colsel).IsNumeric Then
Dim tgbn As RibbonMenu.ToggleButton = RibbonTabs("Common").Groups("Aggregate").Items("Aggregate")
If tgbn.Pressed Then
With CurrentTable
Dim str1 As String = ""
Dim tbn As RibbonMenu.ToggleButton
Dim cbx As RibbonMenu.Checkbox
Dim itm As RibbonMenu.RibbonItem
For Each itm In RibbonTabs("Common").Groups("Aggregate").Items
Select Case itm.Name
Case "Count"
cbx = itm
If cbx.Checked Then
Str1 = Str1 & "计数:" & t.Aggregate(AggregateEnum.Count, t.TopRow, t.LeftCol, t.BottomRow, t.RightCol) & " "
End If
Case "Sum"
cbx = itm
If cbx.Checked Then
Str1 = Str1 & "累计:" & t.Aggregate(AggregateEnum.Sum, t.TopRow, t.LeftCol, t.BottomRow, t.RightCol) & " "
End If
Case "Average"
cbx = itm
If cbx.Checked Then
Str1 = Str1 & "平均:" & t.Aggregate(AggregateEnum.Average, t.TopRow, t.LeftCol, t.BottomRow, t.RightCol) & " "
End If
Case "Max"
cbx = itm
If cbx.Checked Then
Str1 = Str1 & "最大:" & t.Aggregate(AggregateEnum.Max, t.TopRow, t.LeftCol, t.BottomRow, t.RightCol) & " "
End If
Case "Min"
cbx = itm
If cbx.Checked Then
Str1 = Str1 & "最小:" & t.Aggregate(AggregateEnum.Min, t.TopRow, t.LeftCol, t.BottomRow, t.RightCol) & " "
End If
Case "Var"
tbn = itm
If tbn.Pressed Then
Str1 = Str1 & "标准差:" & t.Aggregate(AggregateEnum.Std, t.TopRow, t.LeftCol, t.BottomRow, t.RightCol) & " "
End If
Case "VarPop"
tbn = itm
If tbn.Pressed Then
Str1 = Str1 & "总体标准差:" & t.Aggregate(AggregateEnum.StdPop, t.TopRow, t.LeftCol, t.BottomRow, t.RightCol) & " "
End If
Case "Std"
tbn = itm
If tbn.Pressed Then
Str1 = Str1 & "方差:" & t.Aggregate(AggregateEnum.Var, t.TopRow, t.LeftCol, t.BottomRow, t.RightCol) & " "
End If
Case "StdPop"
tbn = itm
If tbn.Pressed Then
Str1 = Str1 & "总体方差:" & t.Aggregate(AggregateEnum.VarPop, t.TopRow, t.LeftCol, t.BottomRow, t.RightCol) & " "
End If
End Select
Next
StatusBar.Message3 = Str1
End With
End If
End If