Spread Windows Forms 15.0
Spread Windows Forms 15.0 Product Documentation / Developer's Guide / Touch Support with the Component / Using a Touch Keyboard
In This Topic
    Using a Touch Keyboard
    In This Topic

    You can display a touch keyboard when editing a cell.

    Use the ShowTouchKeyboard method to display the keyboard as in the following image.

    Touch Keyboard

    You can also specify whether the cell being edited scrolls into view when the touch keyboard is displayed by setting the AutoScrollWhenKeyboardShowing property. FpSpread will scroll up as soon as possible, but if there is not enough space to scroll, the active cell may not be visible. For example, if the control is completely covered by the touch keyboard, the control scrolls the active cell to the first row (cell still hidden by keyboard).

    FpSpread provides an InputScope property that can be used to specify the touch keyboard's layout.

    You can use the ShowTouchKeyboard and HideTouchKeyboard methods in the EditModeOn event to show the touch keyboard when the cell goes into edit mode.

    Using Code

    The following example displays the touch keyboard when the cell is in edit mode and hides it when the cell is no longer in edit mode.

    C#
    Copy Code
    private void Form1_Load(object sender, EventArgs e)
    {
        fpSpread1.AutoScrollWhenKeyboardShowing = true;
    }
    private void fpSpread1_EditModeOn(object sender, EventArgs e)
    {
        fpSpread1.ShowTouchKeyboard();
    }
    private void fpSpread1_EditModeOff(object sender, EventArgs e)
    {
        fpSpread1.HideTouchKeyboard();
    }
    
    Visual Basic
    Copy Code
    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        FpSpread1.AutoScrollWhenKeyboardShowing = True
    End Sub
    Private Sub FpSpread1_EditModeOn(sender As Object, e As System.EventArgs) Handles FpSpread1.EditModeOn
        FpSpread1.ShowTouchKeyboard()
    End Sub
    Private Sub FpSpread1_EditModeOff(sender As Object, e As System.EventArgs) Handles FpSpread1.EditModeOff
        FpSpread1.HideTouchKeyboard()
    End Sub
    
    See Also