HeaderPane
Main
Hide
Share Link
Print

UpDownPress Event, SftMask Object

The up/down button is pressed.

Syntax

C#void object_UpDownPress(object sender, EventArgumentType e);
VB.NETPrivate Sub object_UpDownPress(ByVal sender As Object, ByVal e As EventArgumentType) Handles object.UpDownPress
C++void OnUpDownPressobject(VARIANT_BOOL Up, long FieldStart, long FieldEnd, long Counter, _bstr_t* Field);
CHRESULT OnUpDownPressobject(VARIANT_BOOL Up, long FieldStart, long FieldEnd, long Counter, BSTR* Field);

object

A SftMask object.

Up

True if the upper button was pressed, usually indicating a value increment or False if the lower button was pressed.

FieldStart

The starting position of the numeric field.

FieldEnd

The ending position of the numeric field (the position following its last character).

Counter

The current event counter. The event count starts at 0 when the up/down button is first pressed (or when the up/down arrow key is used). While the button (or key) remains pressed, the UpDownPress event occurs at regular intervals (every 0.1 seconds), each time the Counter value is incremented by 1. This can be used to delay additional increments or decrements by waiting until Counter reaches a certain value. It can also be used to accelerate or increase the increment used. The example below shows how this can be implemented.

Field

The contents of the numeric field as a string. The application returns a new string value in this argument. If the Field value is not modified by the application, the up/down button has no effect.

Comments

The UpDownPress event occurs when the up/down button is pressed.

The UpDownPress event only occurs for numeric fields without minimum/maximum range.

The UpDownHandled event occurs after the UpDownPress event, indicating that the control contents have been modified using the up/down button.

Examples

VB.NET View entire sample code

    SftMaskSSN.Text = "444-12-1111" ' a social security number
    SftMaskToday.Contents.DateTime = Today ' set today's date
    SftMaskTime.Contents.DateTime = TimeOfDay
    SftMaskPercent.Contents.Value(0) = 50 ' start with 50 percent
    SftMaskAmount.Text = CStr(199)
    SftMaskIPAddr.Text = "209.61.201.49"
End Sub

Private Sub SftMaskAmount_UpDownPress(ByVal sender As Object, ByVal e As AxSftMaskLib80._ISftMaskEvents_UpDownPressEvent) Handles SftMaskAmount.UpDownPress
    Dim Amount As Double
    Dim Increment As Single
    If e.counter = 0 Or e.counter > 5 Then
        Amount = Val(e.field)
        Increment = 0.01
        If e.counter > 14 Then Increment = 0.1
        If e.counter > 23 Then Increment = 1

C++ View entire sample code

        SysFreeString(*Field);
        *Field = SysAllocString(szBuffer);
    }
}

BEGIN_EVENTSINK_MAP(CSample1Dlg, CDialog)
    //{{AFX_EVENTSINK_MAP(CSample1Dlg)
	ON_EVENT(CSample1Dlg, IDC_SFTMASKAMOUNT, 29 /* UpDownPress */, OnUpDownPressSftMaskAmount, VTS_BOOL VTS_I4 VTS_I4 VTS_I4 VTS_PBSTR)
	//}}AFX_EVENTSINK_MAP
END_EVENTSINK_MAP()


BOOL CSample1Dlg::OnWndMsg(UINT message, WPARAM wParam, LPARAM lParam, LRESULT* pResult)
{
    INT_PTR dmResult;
    if (SftDarkMode_HandleDialogMessage(m_hWnd, message, wParam, lParam, &dmResult)) {

See Also SftMask Events | Object Hierarchy


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