HeaderPane
Main
Hide
Share Link
Print

UpDownPressEventArgs Class

Provides data for the SftMask.UpDownPress event.

An event handler can set UpDownPressEventArgs.FieldText to the field's new text, or set Handled to keep the control from stepping the field (SftMask.SpinIncrement and SftMask.SpinAccelerations properties).

Namespace: Softelvdm.SftMaskNET
Assembly: Softelvdm.SftMaskNET

Inheritance

Syntax

public class UpDownPressEventArgs : System.EventArgs;
Public Class UpDownPressEventArgs
    Inherits System.EventArgs

Constructors

This class cannot be instantiated.

Properties

PublicCounterReturns how often the event was raised while the button or key is held down; 0 for the first time.
PublicFieldEndReturns the position following the numeric field.
PublicFieldStartReturns the first position of the numeric field.
PublicFieldTextDefines the text of the numeric field.
PublicHandledDefines whether the application handled the press; the control's own step is then not used.
PublicUpReturns whether the field is increased (the up button, the Up key or the SftMask.SpinUp method).

Fields

PublicStaticInherited from System.EventArgsEmptyProvides a value to use with events that do not have event data.

Methods

PublicInherited from System.ObjectEqualsDetermines whether the specified object is equal to the current object.
ProtectedInherited from System.ObjectFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
PublicInherited from System.ObjectGetHashCodeServes as the default hash function.
PublicInherited from System.ObjectGetTypeGets the Type of the current instance.
ProtectedInherited from System.ObjectMemberwiseCloneCreates a shallow copy of the current Object.
PublicStaticInherited from System.ObjectReferenceEqualsDetermines whether the specified Object instances are the same instance.
PublicInherited from System.ObjectToStringReturns a string that represents the current object.

Examples

C# View entire sample code

        }

        // Amounts over 10,000 are not accepted.
        private void sftMask1_CustomValidation(object sender, CancelEventArgs e) {
            e.Cancel = sftMask1.Value.HasValue && sftMask1.Value.Value > 10000;
            DumpValues("sftMask1.CustomValidation" + (e.Cancel ? " (over 10,000, refused)" : ""), e);
        }

        private void sftMask1_UpDownPress(object sender, UpDownPressEventArgs e) {
            DumpValues("sftMask1.UpDownPress", e);
        }

        private void sftMask1_CalculatorOpening(object sender, CalculatorOpeningEventArgs e) {
            e.Cancel = checkBlock.Checked;
            DumpValues("sftMask1.CalculatorOpening" + (e.Cancel ? " (canceled)" : ""), e);
        }

VB.NET View entire sample code

    End Sub

    ' Amounts over 10,000 are not accepted.
    Private Sub SftMask1_CustomValidation(ByVal sender As Object, ByVal e As CancelEventArgs) Handles SftMask1.CustomValidation
        e.Cancel = SftMask1.Value.HasValue AndAlso SftMask1.Value.Value > 10000
        DumpValues("SftMask1.CustomValidation" + If(e.Cancel, " (over 10,000, refused)", ""), e)
    End Sub

    Private Sub SftMask1_UpDownPress(ByVal sender As Object, ByVal e As UpDownPressEventArgs) Handles SftMask1.UpDownPress
        DumpValues("SftMask1.UpDownPress", e)
    End Sub

    Private Sub SftMask1_CalculatorOpening(ByVal sender As Object, ByVal e As CalculatorOpeningEventArgs) Handles SftMask1.CalculatorOpening
        e.Cancel = CheckBlock.Checked
        DumpValues("SftMask1.CalculatorOpening" + If(e.Cancel, " (canceled)", ""), e)
    End Sub

See Also Classes | SftMask/NET 3.0