Hide

SftMask/OCX 7.0 - ActiveX Masked Edit Control

Display
Print

Calculator Property, SftMask Object

Returns the SftMaskCalculator object.

Syntax

Get

VB.NETrefCalculatorObj = object.Calculator As SftMaskCalculator
VBSet refCalculatorObj = object.Calculator As SftMaskCalculator
C#.NETSftMaskCalculator refCalculatorObj = object.Calculator;
VC++ISftMaskCalculator* refCalculatorObj = object->Calculator;
ISftMaskCalculator* refCalculatorObj = object->GetCalculator();
CHRESULT object->get_Calculator(ISftMaskCalculator** refCalculatorObj);

object

A SftMask object.

refCalculatorObj

Returns the SftMaskCalculator object.

Comments

The Calculator property returns the SftMaskCalculator object.

The properties of the popup calculator can be updated using the returned SftMaskCalculator object.

Examples

VB.NET

    Dim CalcObj As SftMaskCalculator
    AxSftMask1.Caption.SizePercent = 33
    AxSftMask1.Caption.Text = "&Amount:"
    AxSftMask1.Mask = "| $C-,8.2"
    AxSftMask1.Alignment = SftMaskAlignConstants.alignSftMaskRight
    AxSftMask1.EntrySelect = SftMaskEntrySelectConstants.entrySftMaskSelectEnd
    AxSftMask1.Text = 10
    CalcObj = AxSftMask1.Calculator
    CalcObj.Lines = 12
    CalcObj.FracDigits = 2
    CalcObj.BackColor = Convert.ToUInt32(ColorTranslator.ToOle(SystemColors.Info) And &HFFFFFFFF&)
    CalcObj.ForeColor = Convert.ToUInt32(ColorTranslator.ToOle(SystemColors.InfoText) And &HFFFFFFFF&)
    CalcObj.TotalBackColor = Convert.ToUInt32(ColorTranslator.ToOle(SystemColors.Highlight) And &HFFFFFFFF&)
    CalcObj.TotalForeColor = Convert.ToUInt32(ColorTranslator.ToOle(SystemColors.HighlightText) And &HFFFFFFFF&)

    AxSftMask1.SelStart = 0 ' intentionally "bad" position

VB6

    Dim CalcObj As SftMaskLib70.SftMaskCalculator
    SftMask1.Caption.SizePercent = 33
    SftMask1.Caption.Text = "&Amount:"
    SftMask1.Mask = "| $C-,8.2"
    SftMask1.Alignment = alignSftMaskRight
    SftMask1.EntrySelect = entrySftMaskSelectEnd
    SftMask1.Text = 10
    Set CalcObj = SftMask1.Calculator
    CalcObj.Lines = 12
    CalcObj.FracDigits = 2
    CalcObj.BackColor = vbInfoBackground
    CalcObj.ForeColor = vbInfoText
    CalcObj.TotalBackColor = vbHighlight
    CalcObj.TotalForeColor = vbHighlightText

    SftMask1.SelStart = 0 ' intentionally "bad" position

C#

private void Form1_Load(object sender, System.EventArgs e)
{
    Font BoldFont = new Font("Times New Roman", 12, FontStyle.Bold);
    axSftMask1.Font = BoldFont;
    Font NormFont = new Font("Times New Roman", 12, FontStyle.Regular);
    axSftMask1.Caption.Font = OLECvt.ToIFontDisp(NormFont);

    SftMaskCalculator CalcObj = axSftMask1.Calculator;

    axSftMask1.Caption.SizePercent = 33;
    axSftMask1.Caption.Text = "&Amount:";
    axSftMask1.Mask = "| $C-,8.2";
    axSftMask1.Alignment = SftMaskAlignConstants.alignSftMaskRight;
    axSftMask1.EntrySelect = SftMaskEntrySelectConstants.entrySftMaskSelectEnd;
    axSftMask1.Text = "10";

C++

    pFontDisp = m_pMask1->Caption->GetFont();
    pFont = pFontDisp;
    pFont->put_Name(L"Times New Roman");
    pFont->put_Bold(FALSE);
    size.int64 = 12*10000L; //12 point font
    pFont->put_Size(size);

    ISftMaskCalculatorPtr pCalc;
    pCalc = m_pMask1->Calculator;

    m_pMask1->Caption->SizePercent = 33;
    m_pMask1->Caption->Text = _T("&Amount:");
    m_pMask1->Mask = _T("| $C-,8.2");
    m_pMask1->Alignment = alignSftMaskRight;
    m_pMask1->EntrySelect = entrySftMaskSelectEnd;
    m_pMask1->Text = _T("10");

See Also SftMask Object | Object Hierarchy


Last Updated 08/13/2020 - (email)
© 2024 Softel vdm, Inc.