Hide

SftMask/OCX 7.0 - ActiveX Masked Edit Control

Display
Print

Alignment Property, SftMask Object

Defines the text alignment.

Syntax

Get

VB.NETAlign = object.Alignment As SftMaskAlignConstants
VBAlign = object.Alignment As SftMaskAlignConstants
C#.NETSftMaskAlignConstants Align = object.Alignment;
VC++enum SftMaskAlignConstants Align = object->Alignment;
enum SftMaskAlignConstants Align = object->GetAlignment();
CHRESULT object->get_Alignment(enum SftMaskAlignConstants* Align);

Put

VB.NETobject.Alignment = Align As SftMaskAlignConstants
VBobject.Alignment = Align As SftMaskAlignConstants
C#.NETSftMaskAlignConstants object.Alignment = Align;
VC++enum SftMaskAlignConstants object->Alignment = Align;
void object->PutAlignment(enum SftMaskAlignConstants Align);
CHRESULT object->put_Alignment(enum SftMaskAlignConstants Align);

object

A SftMask object.

Align

Defines the text alignment.

AlignValueDescription
alignSftMaskLeft0The text in the edit control is left adjusted.
alignSftMaskCenter1The text in the edit control is left adjusted if the control has the input focus. The text is centered only if the control does not have the input focus.
alignSftMaskRight2The text in the edit control is right adjusted.

Comments

The Alignment property defines the text alignment.

The Alignment property defines the horizontal text alignment of the edit control. It applies to the contents of the edit control (Text and FormattedText properties).

The caption's alignment is defined using the Caption.Alignment property.

Examples

VB.NET

    AxSftMask1.Font = BoldFont
    Dim NormFont As New Font("Times New Roman", 12, FontStyle.Regular)
    AxSftMask1.Caption.Font = OLECvt.ToIFontDisp(NormFont)

    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&)

VB6

    SftMask1.Caption.Font.Name = "Times New Roman"
    SftMask1.Caption.Font.Bold = False
    SftMask1.Caption.Font.Size = 12

    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

C#

    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";

    CalcObj.Lines = 12;
    CalcObj.FracDigits = 2;
    CalcObj.BackColor = (uint) ColorTranslator.ToOle(SystemColors.Info);
    CalcObj.ForeColor = (uint) ColorTranslator.ToOle(SystemColors.InfoText);

C++

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

    pCalc->Lines = 12;
    pCalc->FracDigits = 2;
    pCalc->BackColor = COLOR_INFOBK |0x80000000L;
    pCalc->ForeColor = COLOR_INFOTEXT |0x80000000L;

See Also SftMask Object | Object Hierarchy


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