Foxtable(狐表)用户栏目专家坐堂 → 自动计算和记录窗口的问题


  共有3408人关注过本帖树形打印复制链接

主题:自动计算和记录窗口的问题

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


加好友 发短信
等级:幼狐 帖子:125 积分:1544 威望:0 精华:0 注册:2017/3/16 1:12:00
自动计算和记录窗口的问题  发帖心情 Post By:2017/4/19 15:36:00 [只看该作者]

蓝、色俩老师好!

两问题:1、杂项中的“自动计算”按示例的实战菜单中做了但就是没见动静。

           计算图示命令:RaiseSystemEventCurrentTable,SystemEventTypeEnum.AfterSelRangeChange)
           单元数:RaiseSystemEvent(CurrentTable,SystemEventTypeEnum.AfterSelRangeChange)       
            。。。。。。
2、系统配置栏中的“记录窗口”如何加入项目的配置栏中(即代码)?网上交流他们的问题可深奥了。。  
[此贴子已经被作者于2017/4/19 15:36:57编辑过]

 回到顶部
帅哥哟,离线,有人找我吗?
Zhao2006
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:幼狐 帖子:125 积分:1544 威望:0 精华:0 注册:2017/3/16 1:12:00
  发帖心情 Post By:2017/4/19 15:45:00 [只看该作者]

上传的图片附件咋就是
图片点击可在新窗口打开查看此主题相关图片如下:计算.jpg
图片点击可在新窗口打开查看
不见呢?再传一次。。

 回到顶部
帅哥哟,离线,有人找我吗?
有点色
  3楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:13837 积分:69650 威望:0 精华:0 注册:2016/11/1 14:42:00
  发帖心情 Post By:2017/4/19 15:46:00 [只看该作者]

1、你去看看人家主菜单SystemIdle和AfterSelRangeChange事件的代码

 

2、直接把代码拷贝过来即可。


 回到顶部
帅哥哟,离线,有人找我吗?
Zhao2006
  4楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:幼狐 帖子:125 积分:1544 威望:0 精华:0 注册:2017/3/16 1:12:00
  发帖心情 Post By:2017/4/19 16:26:00 [只看该作者]

收到,谢色老师,示例菜单的SystemIdle中有乱七八糟的东西,不删嘛就死机,把没用的删了嘛运行到计数的这地方又有提示错误的,



If CurrentTable Is Nothing Then
    Return
End If



'以下代码用于更新配置栏"查阅模式"按钮的状态,如果按钮已经改名或者移到别的功能区,请对应地修改此段代码
'如果删除此按钮,也应该删除此段代码
Static bm As RibbonMenu.ToggleButton
If bm Is Nothing Then
    bm = Ctype(ConfigBar.Items("BrowseMode"),RibbonMenu.ToggleButton)
End If
If DataTables.AllowEdit Then
    If bm.Pressed Then bm.Pressed = False
Else
   If bm.Pressed =False Then bm.Pressed = True
End If



'以下代码用于在状态栏显示自动计算结果,如果不需要自动计算,可删除这一段
If Vars("SysUpdateAggregate") 
    If Windows.Forms.Control.MouseButtons <> Windows.Forms.MouseButtons.None OrElse Windows.Forms.Control.ModifierKeys <> Windows.Forms.Keys.None Then
        Return
    End If
    Dim Str1 As String = ""
    Vars("SysUpdateAggregate") = False
    With RibbonTabs("Other").Groups("Aggregate")
        With CType(.Items("Aggregate"), RibbonMenu.ToggleButton)
            If .Pressed = False Then
                Return
            End If
        End With
        If CType(.Items("Count"), RibbonMenu.CheckBox).Checked Then
            Str1 = Str1 & "计数:" & t.Aggregate(AggregateEnum.Count, t.TopRow, t.LeftCol, t.BottomRow, t.RightCol) & " "
        End If
        If CType(.Items("Sum"), RibbonMenu.CheckBox).Checked Then
            Str1 = Str1 & "累计:" & t.Aggregate(AggregateEnum.Sum, t.TopRow, t.LeftCol, t.BottomRow, t.RightCol) & " "
        End If
        If CType(.Items("Average"), RibbonMenu.CheckBox).Checked Then
            Str1 = Str1 & "平均:" & t.Aggregate(AggregateEnum.Average, t.TopRow, t.LeftCol, t.BottomRow, t.RightCol) & " "
        End If
        If CType(.Items("Max"), RibbonMenu.CheckBox).Checked Then
            Str1 = Str1 & "最大:" & t.Aggregate(AggregateEnum.Max, t.TopRow, t.LeftCol, t.BottomRow, t.RightCol) & " "
        End If
        If CType(.Items("Min"), RibbonMenu.CheckBox).Checked Then
            Str1 = Str1 & "最小:" & t.Aggregate(AggregateEnum.Min, t.TopRow, t.LeftCol, t.BottomRow, t.RightCol) & " "
        End If
        With CType(.Items("Other"), RibbonMenu.MenuButton)
            If CType(.Items("Std"), RibbonMenu.ToggleButton).Pressed Then
                Str1 = Str1 & "标准差:" & t.Aggregate(AggregateEnum.Std, t.TopRow, t.LeftCol, t.BottomRow, t.RightCol) & " "
            End If
            If CType(.Items("StdPop"), RibbonMenu.ToggleButton).Pressed Then
                Str1 = Str1 & "总体标准差:" & t.Aggregate(AggregateEnum.StdPop, t.TopRow, t.LeftCol, t.BottomRow, t.RightCol) & " "
            End If
            If CType(.Items("Var"), RibbonMenu.ToggleButton).Pressed Then
                Str1 = Str1 & "方差:" & t.Aggregate(AggregateEnum.Var, t.TopRow, t.LeftCol, t.BottomRow, t.RightCol) & " "
            End If
            If CType(.Items("VarPop"), RibbonMenu.ToggleButton).Pressed Then
                Str1 = Str1 & "总体方差:" & t.Aggregate(AggregateEnum.VarPop, t.TopRow, t.LeftCol, t.BottomRow, t.RightCol) & " "
            End If
        End With
    End With
    RibbonMenu.StatusBar.Message3 = Str1
End If

 回到顶部
帅哥哟,离线,有人找我吗?
Zhao2006
  5楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:幼狐 帖子:125 积分:1544 威望:0 精华:0 注册:2017/3/16 1:12:00
  发帖心情 Post By:2017/4/19 16:27:00 [只看该作者]

提示东西。
图片点击可在新窗口打开查看此主题相关图片如下:错误提示.jpg
图片点击可在新窗口打开查看

 回到顶部
帅哥哟,离线,有人找我吗?
有点色
  6楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:13837 积分:69650 威望:0 精华:0 注册:2016/11/1 14:42:00
  发帖心情 Post By:2017/4/19 16:29:00 [只看该作者]

直接写代码

 

Dim str1 As String = ""
Dim t As Table = CurrentTable

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


StatusBar.Message3 = str1


 回到顶部
帅哥哟,离线,有人找我吗?
有点色
  7楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:13837 积分:69650 威望:0 精华:0 注册:2016/11/1 14:42:00
  发帖心情 Post By:2017/4/19 16:31:00 [只看该作者]

 或者

 

Dim str1 As String = ""
Dim t As Table = CurrentTable
Dim hadString As Boolean = False
For i As Integer = t.LeftCol To t.RightCol
    If t.cols(i).IsString Then
        hadString = True
        Exit For
    End If
Next
Str1 = Str1 & "计数:" & t.Aggregate(AggregateEnum.Count, t.TopRow, t.LeftCol, t.BottomRow, t.RightCol) & " "
If hadString = False Then
    Str1 = Str1 & "累计:" & t.Aggregate(AggregateEnum.Sum, t.TopRow, t.LeftCol, t.BottomRow, t.RightCol) & " "
    Str1 = Str1 & "平均:" & t.Aggregate(AggregateEnum.Average, t.TopRow, t.LeftCol, t.BottomRow, t.RightCol) & " "
    Str1 = Str1 & "最大:" & t.Aggregate(AggregateEnum.Max, t.TopRow, t.LeftCol, t.BottomRow, t.RightCol) & " "
    Str1 = Str1 & "最小:" & t.Aggregate(AggregateEnum.Min, t.TopRow, t.LeftCol, t.BottomRow, t.RightCol) & " "
    Str1 = Str1 & "标准差:" & t.Aggregate(AggregateEnum.Std, t.TopRow, t.LeftCol, t.BottomRow, t.RightCol) & " "
    Str1 = Str1 & "总体标准差:" & t.Aggregate(AggregateEnum.StdPop, t.TopRow, t.LeftCol, t.BottomRow, t.RightCol) & " "
    Str1 = Str1 & "方差:" & t.Aggregate(AggregateEnum.Var, t.TopRow, t.LeftCol, t.BottomRow, t.RightCol) & " "
    Str1 = Str1 & "总体方差:" & t.Aggregate(AggregateEnum.VarPop, t.TopRow, t.LeftCol, t.BottomRow, t.RightCol) & " "
End If

StatusBar.Message3 = str1


 回到顶部
帅哥哟,离线,有人找我吗?
Zhao2006
  8楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:幼狐 帖子:125 积分:1544 威望:0 精华:0 注册:2017/3/16 1:12:00
  发帖心情 Post By:2017/4/19 16:35:00 [只看该作者]

呵呵,还是色老师这招厉害!结果真的出来了,但这时是全部出来了,你不勾它都出来的摆在下栏那里,谢色老师了。

 回到顶部
帅哥哟,离线,有人找我吗?
有点色
  9楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:13837 积分:69650 威望:0 精华:0 注册:2016/11/1 14:42:00
  发帖心情 Post By:2017/4/19 16:46:00 [只看该作者]

Dim str1 As String = ""
Dim t As Table = CurrentTable
With RibbonTabs("Other").Groups("Aggregate")
    With CType(.Items("Aggregate"), RibbonMenu.ToggleButton)
        If .Pressed = False Then
           ' Return
        End If
    End With
    If CType(.Items("Count"), RibbonMenu.CheckBox).Checked Then
        Str1 = Str1 & "计数:" & t.Aggregate(AggregateEnum.Count, t.TopRow, t.LeftCol, t.BottomRow, t.RightCol) & " "
    End If
    If CType(.Items("Sum"), RibbonMenu.CheckBox).Checked Then
        Str1 = Str1 & "累计:" & t.Aggregate(AggregateEnum.Sum, t.TopRow, t.LeftCol, t.BottomRow, t.RightCol) & " "
    End If
    If CType(.Items("Average"), RibbonMenu.CheckBox).Checked Then
        Str1 = Str1 & "平均:" & t.Aggregate(AggregateEnum.Average, t.TopRow, t.LeftCol, t.BottomRow, t.RightCol) & " "
    End If
    If CType(.Items("Max"), RibbonMenu.CheckBox).Checked Then
        Str1 = Str1 & "最大:" & t.Aggregate(AggregateEnum.Max, t.TopRow, t.LeftCol, t.BottomRow, t.RightCol) & " "
    End If
    If CType(.Items("Min"), RibbonMenu.CheckBox).Checked Then
        Str1 = Str1 & "最小:" & t.Aggregate(AggregateEnum.Min, t.TopRow, t.LeftCol, t.BottomRow, t.RightCol) & " "
    End If
    With CType(.Items("Other"), RibbonMenu.MenuButton)
        If CType(.Items("Std"), RibbonMenu.ToggleButton).Pressed Then
            Str1 = Str1 & "标准差:" & t.Aggregate(AggregateEnum.Std, t.TopRow, t.LeftCol, t.BottomRow, t.RightCol) & " "
        End If
        If CType(.Items("StdPop"), RibbonMenu.ToggleButton).Pressed Then
            Str1 = Str1 & "总体标准差:" & t.Aggregate(AggregateEnum.StdPop, t.TopRow, t.LeftCol, t.BottomRow, t.RightCol) & " "
        End If
        If CType(.Items("Var"), RibbonMenu.ToggleButton).Pressed Then
            Str1 = Str1 & "方差:" & t.Aggregate(AggregateEnum.Var, t.TopRow, t.LeftCol, t.BottomRow, t.RightCol) & " "
        End If
        If CType(.Items("VarPop"), RibbonMenu.ToggleButton).Pressed Then
            Str1 = Str1 & "总体方差:" & t.Aggregate(AggregateEnum.VarPop, t.TopRow, t.LeftCol, t.BottomRow, t.RightCol) & " "
        End If
    End With
End With

StatusBar.Message3 = str1


 回到顶部
帅哥哟,离线,有人找我吗?
Zhao2006
  10楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:幼狐 帖子:125 积分:1544 威望:0 精华:0 注册:2017/3/16 1:12:00
  发帖心情 Post By:2017/4/19 16:47:00 [只看该作者]

不选勾它6、7个数也摆在下栏给你出来完的,把“自动计算”按键按上来都没有作用的,数值照列无误的了。
图片点击可在新窗口打开查看此主题相关图片如下:问题2.jpg
图片点击可在新窗口打开查看

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