Hide

SftTree/OCX 7.5 - ActiveX Tree Control

Display
Print

Text Property, SftTreeRowHeader Object

Defines the row header's text.

Syntax

Get

VB.NETString = object.Text As String
VBString = object.Text As String
C#.NETstring String = object.Text;
VC++_bstr_t String = object->Text;
_bstr_t String = object->GetText();
CHRESULT object->get_Text(BSTR* String);

Put

VB.NETobject.Text = String As String
VBobject.Text = String As String
C#.NETstring object.Text = String;
VC++_bstr_t object->Text = String;
void object->PutText(_bstr_t String);
CHRESULT object->put_Text(BSTR String);

object

A SftTreeRowHeader object.

String

Defines the row header's text.

Comments

The Text property defines the row header's text.

The Items.Add and Items.Insert methods add new items. The default text of the row header depends on the RowHeaders.Appearance property.

Row headers can support multiple text lines (see RowHeaders.Lines) by using new-line characters (CR-LF) to start a new line. Word-wrap is not supported.

The default alignment for all row headers is defined using the RowHeaders.TextHAlign and RowHeaders.TextVAlign properties. A row header can override the default using the RowHeader.TextHAlign and RowHeader.TextVAlign properties.

Examples

VB.NET

    End Sub

    Private Sub AxSftTree1_VirtualItem(ByVal sender As Object, ByVal e As AxSftTreeLib75._DSftTreeEvents_VirtualItemEvent) Handles AxSftTree1.VirtualItem
        e.itemObject.Item.Cell(0).Text = "Item " & e.rowIndex
        e.itemObject.Item.Cell(1).Text = "Cell " & e.rowIndex
        e.itemObject.Item.Cell(2).Text = "A"
        e.itemObject.Item.Cell(3).Text = (e.rowIndex Mod 7)
        e.itemObject.Item.Cell(4).Text = "Last " & e.rowIndex
        e.itemObject.Item.RowHeader.Text = "R" & e.rowIndex
        e.itemObject.Item.Enabled = ((e.rowIndex Mod 2) = 0)

        If e.rowIndex Mod 17 = 0 Then
            e.itemObject.Item.RowHeader.Image.NETImageObject = imageListBitmaps.Images(e.rowIndex Mod 10)
        End If
        If e.rowIndex Mod 3 = 0 Then
            e.itemObject.Item.Cell(1).ForeColor = OLECvt.ToOleColor(System.Drawing.Color.Red)

VB6

End Sub

Private Sub SftTree1_VirtualItem(ByVal RowIndex As Long, ByVal ItemObject As VirtualItem)
    ItemObject.Item.Cell(0).Text = "Item " & RowIndex
    ItemObject.Item.Cell(1).Text = "Cell " & RowIndex
    ItemObject.Item.Cell(2).Text = "A"
    ItemObject.Item.Cell(3).Text = RowIndex Mod 7
    ItemObject.Item.Cell(4).Text = "Last " & RowIndex
    ItemObject.Item.RowHeader.Text = "R" & RowIndex
    ItemObject.Item.Enabled = ((RowIndex Mod 2) = 0)

    If RowIndex Mod 17 = 0 Then
        ItemObject.Item.RowHeader.Image.Picture = Image1(RowIndex Mod 10).Picture
    End If
    If RowIndex Mod 3 = 0 Then
        ItemObject.Item.Cell(1).ForeColor = vbRed

C#

        private void axSftTree1_VirtualItem(object sender, AxSftTreeLib75._DSftTreeEvents_VirtualItemEvent e) {

            e.itemObject.Item.get_Cell(0).Text = "Item " + e.rowIndex;
            e.itemObject.Item.get_Cell(1).Text = "Cell " + e.rowIndex.ToString();
            e.itemObject.Item.get_Cell(2).Text = "A";
            e.itemObject.Item.get_Cell(3).Text = (e.rowIndex % 7).ToString();
            e.itemObject.Item.get_Cell(4).Text = "Last " + e.rowIndex.ToString();
            e.itemObject.Item.RowHeader.Text = "R" + e.rowIndex.ToString();
            e.itemObject.Item.Enabled = ((e.rowIndex % 2) == 0);

            if (e.rowIndex % 17 == 0)
                e.itemObject.Item.RowHeader.Image.NETImageObject = imageListBitmaps.Images[e.rowIndex % 10];
            if (e.rowIndex % 3 == 0) {
                e.itemObject.Item.get_Cell(1).ForeColor = OLECvt.ToOleColor(System.Drawing.Color.Red);
                e.itemObject.Item.get_Cell(1).BackColor = OLECvt.ToOleColor(System.Drawing.Color.Aqua);
            }

C++

    str.Format(_T("%ld"), RowIndex % 7);
    pItemObj->Item->Cell[3]->Text = (LPCTSTR) str;

    str.Format(_T("Last %ld"), RowIndex);
    pItemObj->Item->Cell[4]->Text = (LPCTSTR) str;

    str.Format(_T("R%ld"), RowIndex);
    pItemObj->Item->RowHeader->Text = (LPCTSTR) str;

    pItemObj->Item->Enabled = ((RowIndex % 2) == 0) ? VARIANT_TRUE : VARIANT_FALSE;

    if (RowIndex % 17 == 0)
        pItemObj->Item->RowHeader->Image->SetImageListH((OLE_HANDLE)(HIMAGELIST)m_Bitmaps, (short)(RowIndex % 10));
    if (RowIndex % 3 == 0) {
        pItemObj->Item->Cell[1]->ForeColor = RGB(255,0,0);
        pItemObj->Item->Cell[1]->BackColor = RGB(255,255,255);

See Also SftTreeRowHeader Object | Object Hierarchy


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