此主题相关图片如下:企业微信截图_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编辑过]