想用 PointFar Spread 的 RadioButton MultiOption 进行单选,但是自带的 Spread Designer选择 cell style 为 MultiOption 后没有任何效果,没有checkbox 好用。只好采用代码的方式解决了。
'1.将以下代码 放入 Form Load 或其他事件中
With Me.spList4.ActiveSheet
Dim multiType As New FarPoint.Win.Spread.CellType.MultiOptionCellType
multiType.Items = New String() {" "}
For i As Integer = 0 To .RowCount - 1
.Cells(i, 0).CellType = multiType
If i = 0 Then
'选中第一行,第一列的 0为选中 1为非选
.Cells(0, 0).Value = 0
End If
Next
End With
'2.然后加入 以下事件代码 实现单选
Private Sub spList4_LeaveCell(ByVal sender As System.Object, ByVal e As FarPoint.Win.Spread.LeaveCellEventArgs) Handles spList4.LeaveCell
Me.spList4.ActiveSheet.Cells(e.Row, 0).Value = 1
Me.spList4.ActiveSheet.Cells(e.NewRow, 0).Value = 0
End Sub