我现在是这样做的,还有其他方法吗? - Private Sub FpSpread1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles FpSpread1.KeyDown
- Try
- Dim col As Integer = FpSpread1_Sheet1.ActiveColumnIndex
- If e.Control Then
- If e.KeyCode = Keys.X Then
- If (col - 4) Mod 5 = 0 OrElse (col - 6) Mod 5 = 0 Then
- e.Handled = True
- End If
- ElseIf e.KeyCode = Keys.C Then
- Dim inputMap As FarPoint.Win.Spread.InputMap
- inputMap = FpSpread1.GetInputMap(FarPoint.Win.Spread.InputMapMode.WhenAncestorOfFocused)
- inputMap.Put(New FarPoint.Win.Spread.Keystroke(Keys.V, Keys.Control), FarPoint.Win.Spread.SpreadActions.ClipboardPasteValues)
- ElseIf e.KeyCode = Keys.V Then
- Dim inputMap1 As FarPoint.Win.Spread.InputMap
- inputMap1 = FpSpread1.GetInputMap(FarPoint.Win.Spread.InputMapMode.WhenFocused)
- inputMap1.Put(New FarPoint.Win.Spread.Keystroke(Keys.V, Keys.Control), FarPoint.Win.Spread.SpreadActions.ClipboardPasteValues)
- End If
- End If
-
- Catch ex As Exception
-
- End Try
- End Sub
复制代码 |