Spread Windows Forms 9.0 Product Documentation > Developer's Guide > Using Touch Support with the Component > Using Touch Support > Using a Touch Keyboard |
You can display a touch keyboard when editing a cell.
Use the ShowTouchKeyboard method to display the keyboard as in the following image.
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. This property is supported in Microsoft Windows 8 and Windows Server 2012.
You can use the ShowTouchKeyboard and HideTouchKeyboard methods in the EditModeOn event to show the touch keyboard when the cell goes into edit mode.
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.
CS |
Copy Code
|
---|---|
private void Form1_Load(object sender, EventArgs e) { fpSpread1.AutoScrollWhenKeyboardShowing = true; fpSpread1.InputScope = FarPoint.Win.InputScopeNameValue.Default; } private void fpSpread1_EditModeOn(object sender, EventArgs e) { fpSpread1.ShowTouchKeyboard(); } private void fpSpread1_EditModeOff(object sender, EventArgs e) { fpSpread1.HideTouchKeyboard(); } |
VB |
Copy Code
|
---|---|
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load FpSpread1.AutoScrollWhenKeyboardShowing = True FpSpread1.InputScope = FarPoint.Win.InputScopeNameValue.Default 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 |