Foxtable(狐表)用户栏目专家坐堂 → [求助]20190609新版下报错


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

主题:[求助]20190609新版下报错

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


加好友 发短信
等级:小狐 帖子:382 积分:2882 威望:0 精华:0 注册:2015/4/29 11:50:00
[求助]20190609新版下报错  发帖心情 Post By:2019/6/10 16:32:00 [只看该作者]


图片点击可在新窗口打开查看此主题相关图片如下:企业微信截图_1560155343378.png
图片点击可在新窗口打开查看
---------------------------
错误
---------------------------
编译错误:与参数“row”匹配的参数从“Double”类型转换为“Integer”类型。错误代码:e.Table.Grid.SetCellStyle(ary(0)+1, ary(1)+1, s)
---------------------------
确定   
---------------------------

20190609新版打开的时候报错 ,然后窗口无法加载,之前版本正常使用,请问该如何修改?

 

 

贴出  AfterSelRangeChange  代码

If vars("stop") = True Then Return
'MessageBox.Show("11")
If ModifierKey <> Keys.Control Then
    'MessageBox.Show(ps.Count )
    For Each p As String In ps
        'MessageBox.Show("13")
        Dim ary() As String = p.Split(",")
        'MessageBox.Show("14")
        If ary(0) >= 0 AndAlso ary(1) >= 0 AndAlso ary(0) <= sjts AndAlso ary(1) <= sjts  Then
            e.Table.Grid.SetCellStyle(ary(0)+1, ary(1)+1, "")
            'MessageBox.Show("16")
        End If
    Next
    'MessageBox.Show("17")
    ps.clear
End If
'MessageBox.Show("1")
For i As Integer = e.NewRange.TopRow To e.NewRange.BottomRow
    'MessageBox.Show("2")
    For j As Integer = e.NewRange.LeftCol To e.NewRange.RightCol
        'MessageBox.Show("3")
        Dim p As String = i & "," & j
        'MessageBox.Show("4")
        If i >= 0 AndAlso j >= 0 AndAlso ps.contains(p) = False Then
            'MessageBox.Show("5")
            ps.add(p)
            'MessageBox.Show("6")
        End If
    Next
Next

Dim sum As Double = 0
Dim Avg As Double = 0
For Each p As String In ps
    Dim ary() As String= p.Split(",")
    If ary(0) >= 0 AndAlso ary(1) >= 0 Then
        Dim s As C1.Win.C1FlexGrid.CellStyle = e.Table.grid.Styles.Add("selected")
        s.backcolor = Color.red '背景
        e.Table.Grid.SetCellStyle(ary(0)+1, ary(1)+1, s)
        e.Table.DataTable.SysStyles("Focus").BackColor = Color.red
        '各种计算
        Dim cval = e.Table(cint(ary(0)), cint(ary(1)))
        sum += val(cval)
        'MessageBox.Show(ps.Count)
        'MessageBox.Show(ary.Length)
    End If
Next
Avg = sum/ps.Count  '平均数
'Avg = sum/1  '平均数
'StatusBar.Message2 = "累计:" & sum & "  " & "平均:" & Avg & "  " & "计数:" & ps.Count
StatusBar.Message2 = "累计:" & Format(sum,"#,###") & "  " & "平均:" & Format(Avg,"#,###") & "  " & "计数:" & ps.Count

 

 

[此贴子已经被作者于2019/6/10 16:42:50编辑过]

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


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2019/6/10 17:59:00 [只看该作者]

改成

 

        e.Table.Grid.SetCellStyle(cint(ary(0)+1), cint(ary(1)+1), s)


 回到顶部