HeaderPane
Main
Hide
Share Link
Print

KeyPress Event, SftCalendar Object

A character key is pressed.

Syntax

C#void object_KeyPressEvent(object sender, AxSftDateLib20._ISftCalendarEvents_KeyPressEvent e);
VB.NETPrivate Sub object_KeyPressEvent(ByVal sender As Object, ByVal e As AxSftDateLib20._ISftCalendarEvents_KeyPressEvent) Handles object.KeyPressEvent
C++void OnKeyPressobject(short* KeyAscii);
CHRESULT OnKeyPressobject(short* KeyAscii);

object

A SftCalendar object.

KeyAscii

The character typed. Setting it to 0 suppresses the character; setting it to another character replaces it.

Comments

The KeyPress event occurs when the user types a character while the control has the input focus. p Characters typed into the text box of a date field control's free-form editing (EditStyle) don't raise the KeyPress event; the KeyDown event occurs for their keys. p Use the KeyDown and KeyUp events to handle keys that don't produce characters, such as function keys and navigation keys.

Examples

VB.NET View entire sample code

    Private Sub sftCalendar_DPIChanged(sender As Object, e As _ISftCalendarEvents_DPIChangedEvent) Handles sftCalendar.DPIChanged
        LogEvent(sender, "DPIChanged", "DPI=" & e.dPI)
    End Sub

    Private Sub sftCalendar_KeyDownEvent(sender As Object, e As _ISftCalendarEvents_KeyDownEvent) Handles sftCalendar.KeyDownEvent
        LogEvent(sender, "KeyDown", "KeyCode=0x" & e.keyCode.ToString("X2") & " Shift=" & e.shift)
    End Sub

    Private Sub sftCalendar_KeyPressEvent(sender As Object, e As _ISftCalendarEvents_KeyPressEvent) Handles sftCalendar.KeyPressEvent
        LogEvent(sender, "KeyPress", "KeyAscii=" & e.keyAscii)
    End Sub

    Private Sub sftCalendar_KeyUpEvent(sender As Object, e As _ISftCalendarEvents_KeyUpEvent) Handles sftCalendar.KeyUpEvent
        LogEvent(sender, "KeyUp", "KeyCode=0x" & e.keyCode.ToString("X2") & " Shift=" & e.shift)
    End Sub

See Also SftCalendar Object | Object Hierarchy | Keyboard Interface


Last Updated 11/29/2026 - (email)
© 2026 Softel vdm, Inc.