Public Partial Class CustomizingKeyboardShortcuts
Inherits Window
Public Sub New()
InitializeComponent()
End Sub
Private Sub Window_Loaded(ByVal sender As Object, ByVal e As RoutedEventArgs)
' 1. Enterキーを使用してアクティブセルを右に移動します。
gcSpreadSheet.InputBindings.Add(New KeyBinding(BuiltInCommands.MoveRight, New KeyGesture(Key.Enter)))
' 2. Ctrl + Shift + Enterキーを使用してセルの編集を開始します。
gcSpreadSheet.InputBindings.Add(New KeyBinding(BuiltInCommands.EditActiveCell, New KeyGesture(Key.Enter, ModifierKeys.Control Or ModifierKeys.Shift)))
'3. Ctrl + Vキーを使用して既定の貼り付けを無効にします。
'これにより、既定の貼り付けコマンドに割り当てられたCtrl + Vキーがオーバーライドされます。
gcSpreadSheet.InputBindings.Add(New InputBinding(ApplicationCommands.NotACommand, New KeyGesture(Key.V, ModifierKeys.Control)))
End Sub
End Class