您好,
非常抱歉,让您久等了。实现的思路的通过自定义的Action来实现。
- Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
- Me.FpSpread1.ActiveSheet.ColumnCount = 6
- Me.FpSpread1.ActiveSheet.RowCount = 5
- Dim im As New FarPoint.Win.Spread.InputMap
- Dim am As New FarPoint.Win.Spread.ActionMap
- im = FpSpread1.GetInputMap(FarPoint.Win.Spread.InputMapMode.WhenAncestorOfFocused)
- am = FpSpread1.GetActionMap()
- im.Put(New FarPoint.Win.Spread.Keystroke(Keys.Tab, Keys.None), "HideRow")
- am.Put("HideRow", New HideRowAction())
- End Sub
- Private Class HideRowAction
- Inherits FarPoint.Win.Spread.Action
- Public Overrides Sub PerformAction([source] As Object)
- If TypeOf [source] Is SpreadView Then
- Dim spread As SpreadView = CType([source], SpreadView)
- Dim sheet As SheetView = spread.Sheets(spread.ActiveSheetIndex)
- Dim rang As CellRange = sheet.GetSpanCell(sheet.ActiveRowIndex, sheet.ActiveColumnIndex)
- Dim i As Integer
- If (rang Is Nothing) Then
- i = 1
- Else
- i = rang.ColumnCount
- End If
- If sheet.ActiveColumnIndex = (sheet.ColumnCount - i) Then
- sheet.SetActiveCell(sheet.ActiveRowIndex + 1, 0)
- Else
- sheet.SetActiveCell(sheet.ActiveRowIndex, sheet.ActiveColumnIndex + i)
- End If
- End If
- End Sub 'PerformAction
- End Class 'HideRowAction
复制代码
希望能够帮助到您。 |