Spread Windows Forms 13.0 Product Documentation
FarPoint.Win.Spread Assembly / FarPoint.Win.Spread Namespace / SpreadActions Class / DateTimeNow Field

In This Topic
    DateTimeNow Field
    In This Topic
    Sets the cell's value to the date-time value of Now.
    Public Shared ReadOnly DateTimeNow As Object
    Dim value As Object
    value = SpreadActions.DateTimeNow
    public static readonly object DateTimeNow
    This example sets up a map that uses the D key to place the current date in a date cell.
    FarPoint.Win.Spread.InputMap im;
    im = fpSpread1.GetInputMap(FarPoint.Win.Spread.InputMapMode.WhenAncestorOfFocused);
    im.Put(new FarPoint.Win.Spread.Keystroke(Keys.D, Keys.None), FarPoint.Win.Spread.SpreadActions.DateTimeNow);
    Dim im As FarPoint.Win.Spread.InputMap
    im = fpSpread1.GetInputMap(FarPoint.Win.Spread.InputMapMode.WhenAncestorOfFocused)
    im.Put(New FarPoint.Win.Spread.Keystroke(Keys.D, Keys.None), FarPoint.Win.Spread.SpreadActions.DateTimeNow)

    This action places the current date and time (using the NOW function) in the active cell on this sheet. The formatting of the date and time depend on the setting of the DateTimeFormat and other settings of the DateTimeCellType for that cell.

    The default key combination assigned to this action is the F3 key.

    You can use this action along with a custom key combination by defining your own input or action map. For more information about maps, see Managing Keyboard Interactions.

    See Also