Spread Windows Forms 17
Spread Windows Forms 17.0 Product Documentation / Developer's Guide / Keyboard Interaction / Deactivating the Default Keyboard Map
In This Topic
    Deactivating the Default Keyboard Map
    In This Topic

    You can deactivate or turn off the default input map.

    Using Code

    1. Create an InputMap object.
    2. Use the GetInputMap method.

    Example

    This example deactivates the F2 key.

    C#
    Copy Code
    private void Form1_Load(object sender, System.EventArgs e)
    {
       FarPoint.Win.Spread.InputMap im = new FarPoint.Win.Spread.InputMap();
       // Deactivate F2 key in cells not being edited.
       im = fpSpread1.GetInputMap(FarPoint.Win.Spread.InputMapMode.WhenFocused);
       im.Put(new FarPoint.Win.Spread.Keystroke(Keys.F2, Keys.None), FarPoint.Win.Spread.SpreadActions.None);
       // Deactivate F2 key in cells being edited.
       im = fpSpread1.GetInputMap(FarPoint.Win.Spread.InputMapMode.WhenAncestorOfFocused);
    im.Put(new FarPoint.Win.Spread.Keystroke(Keys.F2, Keys.None), FarPoint.Win.Spread.SpreadActions.None);
    }
    
    VB
    Copy Code
    Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
       Dim im As New FarPoint.Win.Spread.InputMap
       ' Deactivate F2 key in cells not being edited.
       im = fpSpread1.GetInputMap(FarPoint.Win.Spread.InputMapMode.WhenFocused)
       im.Put(New FarPoint.Win.Spread.Keystroke(Keys.F2, Keys.None), FarPoint.Win.Spread.SpreadActions.None)
       ' Deactivate F2 key in cells being edited.
       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
    
    See Also