Hide

SftTree/OCX 7.5 - ActiveX Tree Control

Display
Print

TextHAlign Property, SftTreeCell Object

Defines the horizontal alignment of the text in this cell.

Syntax

Get

VB.NETStyle = object.TextHAlign As SftTreeHAlignDefaultConstants
VBStyle = object.TextHAlign As SftTreeHAlignDefaultConstants
C#.NETSftTreeHAlignDefaultConstants Style = object.TextHAlign;
VC++enum SftTreeHAlignDefaultConstants Style = object->TextHAlign;
enum SftTreeHAlignDefaultConstants Style = object->GetTextHAlign();
CHRESULT object->get_TextHAlign(enum SftTreeHAlignDefaultConstants* Style);

Put

VB.NETobject.TextHAlign = Style As SftTreeHAlignDefaultConstants
VBobject.TextHAlign = Style As SftTreeHAlignDefaultConstants
C#.NETSftTreeHAlignDefaultConstants object.TextHAlign = Style;
VC++enum SftTreeHAlignDefaultConstants object->TextHAlign = Style;
void object->PutTextHAlign(enum SftTreeHAlignDefaultConstants Style);
CHRESULT object->put_TextHAlign(enum SftTreeHAlignDefaultConstants Style);

object

A SftTreeCell object.

Style

Defines the horizontal alignment of the text in this cell.

NameValueDescription
halignSftTreeDefaultLeft-1The text is aligned as defined using the default settings for this cell's column (see Column.CellHAlign).
halignSftTreeDefaultLeft0The cell text is left aligned.
halignSftTreeDefaultCenter1The cell text is centered in the cell.
halignSftTreeDefaultRight2The cell text is right aligned.

Comments

The TextHAlign property defines the horizontal alignment of the text in this cell.

The Cell.TextVAlign property is used to define the vertical alignment of the text in this cell.

The TextHAlign property determines the position of the cell text and graphic, defined using the Cell.Text and Cell.Image properties. It overrides the column's default alignment defined using the Column.CellHAlign property.

Examples

VB.NET

        ItemIndex = AxSftTree1.Items.Add("Edit cells" & ControlChars.CrLf & "using SftMask/OCX:")
        AxSftTree1.get_Item(ItemIndex).EditIgnore = True
        AxSftTree1.get_Cell(ItemIndex, 1).Text = ControlChars.CrLf & "using SftBox/OCX:"
        AxSftTree1.get_Cell(ItemIndex, 2).Text = "and again" & ControlChars.CrLf & "using SftMask/OCX:"

        Dim Dt As DateTime
        ItemIndex = AxSftTree1.Items.Add("5.33")
        AxSftTree1.get_Cell(ItemIndex, 0).TextHAlign = SftTreeHAlignDefaultConstants.halignSftTreeDefaultRight
        AxSftTree1.get_Cell(ItemIndex, 1).Text = "Option 1"
        Dt = DateTime.Today.AddDays(-1)
        s = "short"
        SftMaskDateTime.Calendar.FormatDate(Dt, s)
        AxSftTree1.get_Cell(ItemIndex, 2).Text = s
        AxSftTree1.get_Cell(ItemIndex, 2).DataTag = Dt

        ItemIndex = AxSftTree1.Items.Add("122.33")

VB6

      "drop down button to access the popup calendar."

    ItemIndex = SftTree1.Items.Add("Edit cells" & vbCr & vbLf & "using SftMask/OCX:")
    SftTree1.Item(ItemIndex).EditIgnore = True
    SftTree1.Cell(ItemIndex, 1).Text = vbCr & vbLf & "using SftBox/OCX:"
    SftTree1.Cell(ItemIndex, 2).Text = "and again" & vbCr & vbLf & "using SftMask/OCX:"

    ItemIndex = SftTree1.Items.Add("5.33")
    SftTree1.Cell(ItemIndex, 0).TextHAlign = halignSftTreeDefaultRight
    SftTree1.Cell(ItemIndex, 1).Text = "Option 1"
    Dt = Date - 1
    S = "short"
    SftMaskDateTime.Calendar.FormatDate Dt, S
    SftTree1.Cell(ItemIndex, 2).Text = S
    SftTree1.Cell(ItemIndex, 2).DataTag = Dt

C#

            ItemIndex = axSftTree1.Items.Add("Edit cells\r\nusing SftMask/OCX:");
            axSftTree1.get_Item(ItemIndex).EditIgnore = true;
            axSftTree1.get_Cell(ItemIndex, 1).Text = "\r\nusing SftBox/OCX:";
            axSftTree1.get_Cell(ItemIndex, 2).Text = "and again\r\nusing SftMask/OCX:";

            DateTime Dt;

            ItemIndex = axSftTree1.Items.Add("5.33");
            axSftTree1.get_Cell(ItemIndex, 0).TextHAlign = SftTreeHAlignDefaultConstants.halignSftTreeDefaultRight;
            axSftTree1.get_Cell(ItemIndex, 1).Text = "Option 1";
            Dt = DateTime.Today.AddDays(-1);
            string s;
            s = "short";
            SftMaskDateTime.Calendar.FormatDate(Dt, ref  s);
            axSftTree1.get_Cell(ItemIndex, 2).Text = s;
            axSftTree1.get_Cell(ItemIndex, 2).DataTag = Dt;

C++

    DATE Dt = (DATE) COleDateTime::GetCurrentTime();

    ItemIndex = m_vTree->Items->Add(_T("Edit cells\nusing SftMask/OCX:"));
    m_vTree->Item[ItemIndex]->EditIgnore = VARIANT_TRUE;
    m_vTree->Cell[ItemIndex][1]->Text = _T("\nusing SftBox/OCX:");
    m_vTree->Cell[ItemIndex][2]->Text = _T("and again\nusing SftMask/OCX:");

    ItemIndex = m_vTree->Items->Add(_T("5.33"));
    m_vTree->Cell[ItemIndex][0]->TextHAlign = halignSftTreeDefaultRight;
    m_vTree->Cell[ItemIndex][1]->Text = _T("Option 1");
    BSTR str;
    str = SysAllocString(L"short");
    m_vDate->Calendar->FormatDate(Dt-1, &str);
    m_vTree->Cell[ItemIndex][2]->Text = str;
    SysFreeString(str);
    m_vTree->Cell[ItemIndex][2]->DataTag = Dt - 1;

See Also SftTreeCell Object | Object Hierarchy


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