此方法对正常的LeaveCell事件,SelectionChanged事件等都有影响,要根据实际情况进行修正
Private Sub AxvaSpread_Click(sender As Object, e As FarPoint.Win.Spread.CellClickEventArgs) Handles MyBase.CellClick
Dim _LeaveCellEvent As New _DSpreadEvents_LeaveCellEvent(Me.ActiveRow, Me.ActiveCol, e.Row + 1, e.Column + 1)
RaiseEvent LeaveCell(sender, _LeaveCellEvent)
Me.ActiveSheet.SetActiveCell(e.Row, e.Column)
If Me.ActiveSheet.OperationMode = Spread.OperationMode.SingleSelect Then
Me.ActiveSheet.AddSelection(e.Row, 0, 1, Me.MaxCols)
End If
RaiseEvent SelectionChanged(sender, New FarPoint.Win.Spread.SelectionChangedEventArgs(e.View, New FarPoint.Win.Spread.Model.CellRange(e.Row, e.Column, 1, 1)))
e.Cancel = True
RaiseEvent ClickEvent(sender, New _DSpreadEvents_ClickEvent(e.Row + 1, e.Column + 1))
End Sub |