Spread WPF 18
GrapeCity.Wpf.SpreadSheet.CellType.Editors Namespace / GcTextBox Class / ClearCommand Property
Example


In This Topic
    ClearCommand Property (GcTextBox)
    In This Topic
    Represents the ClearCommand command, which requests that GcTextBox to clear all the text.
    Syntax
    'Declaration
     
    Public Shared ReadOnly Property ClearCommand As RoutedUICommand
    'Usage
     
    Dim value As RoutedUICommand
     
    value = GcTextBox.ClearCommand
    public static RoutedUICommand ClearCommand {get;}

    Property Value

    The requested command. Default key gesture is F2.
    Remarks

    This command can only be executed when System.Windows.UIElement.IsEnabled is true and GrapeCity.Windows.InputMan.Primitives.EditBase.IsReadOnly is false.

    This command is natively supported by GcTextBox and the command parameter is ignored.

    Example

    The following example shows how to hook up a System.Windows.Input.RoutedCommand to a InputMan Control.

    InputMan controls provides a library of commands which application programmers encounter regularly. The classes which comprise the command library are: FieldsEditingCommands, CalendarCommands and ControlNavigationCommands. And some commands are defined in some controls class.

    Many controls in InputMan do have built in support for some of the commands in the command library. GcTextBox, for example, supports many of the application edit commands such as System.Windows.Input.ApplicationCommands.Paste, System.Windows.Input.ApplicationCommands.Copy, System.Windows.Input.ApplicationCommands.Cut and System.Windows.Input.ApplicationCommands.Undo. The application developer does not have to do anything special to get these commands to work with these controls. If the GcTextBox is the command target when the command is executed, it will handle the command using the System.Windows.Input.CommandBinding that is built into the control.

    The following shows how to use System.Windows.Input.KeyBinding as the command source for the command defined on GcTextBox, where a GcTextBox is the target of the command. All the logic that defines how the GcTextBox performs the operations is built into the GcTextBox control.

    See Also