PowerTools SPREAD for Windows Forms 8.0J
既定キーの無効化

キー入力に割り当てられた既定のアクションを無効化できます。対象のキー入力に対して、SpreadActionsクラスのNoneアクションを割り当てます。

サンプルコード

次のサンプルコードは、[F2]キーに割り当てられた既定のアクションを無効化します。

C#
コードのコピー
private void Form1_Load(object sender, System.EventArgs e)
{
    FarPoint.Win.Spread.InputMap im = new FarPoint.Win.Spread.InputMap();
    // 編集中ではないセルで[F2]キーを無効にします。
    im = fpSpread1.GetInputMap(FarPoint.Win.Spread.InputMapMode.WhenFocused);
    im.Put(new FarPoint.Win.Spread.Keystroke(Keys.F2, Keys.None), FarPoint.Win.Spread.SpreadActions.None);
    // 編集中のセルで[F2]キーを無効にします。
    im = fpSpread1.GetInputMap(FarPoint.Win.Spread.InputMapMode.WhenAncestorOfFocused);
    im.Put(new FarPoint.Win.Spread.Keystroke(Keys.F2, Keys.None), FarPoint.Win.Spread.SpreadActions.None);
}
Visual Basic
コードのコピー
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
    Dim im As New FarPoint.Win.Spread.InputMap
    ' 編集中ではないセルで[F2]キーを無効にします。
    im = FpSpread1.GetInputMap(FarPoint.Win.Spread.InputMapMode.WhenFocused)
    im.Put(New FarPoint.Win.Spread.Keystroke(Keys.F2, Keys.None), FarPoint.Win.Spread.SpreadActions.None)
    ' 編集中のセルで[F2]キーを無効にします。
    im = FpSpread1.GetInputMap(FarPoint.Win.Spread.InputMapMode.WhenAncestorOfFocused)
    im.Put(New FarPoint.Win.Spread.Keystroke(Keys.F2, Keys.None), FarPoint.Win.Spread.SpreadActions.None)
End Sub
関連トピック

 

 


© 2004-2015, GrapeCity inc. All rights reserved.