HeaderPane
Main
Hide
Share Link
Print

CalculatorOpening Event, SftMask Class

Occurs when an operator typed in a numeric field with a calculator is about to open the calculator.

Class: SftMask
Namespace: Softelvdm.SftMaskNET
Assembly: Softelvdm.SftMaskNET

Syntax

public event EventHandler<CalculatorOpeningEventArgs> CalculatorOpening;
Public Event CalculatorOpening As EventHandler(Of CalculatorOpeningEventArgs)

Comments

Occurs when an operator typed in a numeric field with a calculator is about to open the calculator.

Canceling, or an operator other than +, -, * and /, keeps the calculator closed and ignores the typed character.

Examples

C# View entire sample code

        }

        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);
        }

        private void sftMask1_DropDownOpened(object sender, DropDownEventArgs e) {
            DumpValues("sftMask1.DropDownOpened", e);
        }

        private void sftMask1_DropDownClosed(object sender, DropDownEventArgs e) {

VB.NET View entire sample code

        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

    Private Sub SftMask1_DropDownOpened(ByVal sender As Object, ByVal e As DropDownEventArgs) Handles SftMask1.DropDownOpened
        DumpValues("SftMask1.DropDownOpened", e)
    End Sub

See Also SftMask Class | Classes | SftMask/NET 3.0