Spread7排序之后,点击CheckBox类型的单元格,给所在行设颜色CheckBox的颜色刷新不出来.
1:初期数据如图001.png
代码
Private Sub Form16_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Dim k As Integer
For i As Integer = FpSpread1.ActiveSheet.RowCount - 1 To 0 Step -1
FpSpread1.ActiveSheet.SetValue(k, 1, i)
k = k + 1
Next
End Sub
2:排序,结果如图002.png
代码
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim sortinf(0) As SortInfo
sortinf(0) = New SortInfo(1, True)
FpSpread1.ActiveSheet.SortRows(0, FpSpread1.ActiveSheet.RowCount, sortinf)
End Sub
3:点击CheckBox给行设置颜色,结果如图003.png
代码
Private Sub FpSpread1_ButtonClicked(sender As Object, e As EditorNotifyEventArgs) Handles FpSpread1.ButtonClicked
FpSpread1.ActiveSheet.Cells(e.Row, 0, e.Row, FpSpread1.ActiveSheet.ColumnCount - 1).BackColor = Color.Blue
End Sub
问题是:CheckBox单元格的颜色没有出来.
我想达到的效果是点击CheckBox,整行的颜色都出来,怎么达到这样的效果.如图004. png
|
|