Hide

SftTree/NET 2.0 - Tree Control for Windows Forms

Display
Print

Format Property, TextPartClass Class

Defines display and layout information to render the string.

Class: TextPartClass
Namespace: Softelvdm.Controls
Assembly: Softelvdm.SftTreeNET

Syntax

public StringFormatFlags Format { get; set; }
Public Property Format As StringFormatFlags

Value

The display and layout information.

The default value is StringFormatFlags.DisplayFormatControl, LineLimit.

Comments

Defines display and layout information to render the string.

All of the settings are available, with the exception of the StringFormatFlags.NoWrap member. The TextPartClass.TextStyle property must be used instead.

Examples

C#

            sftTree1.Headers.MaxLines = 4; // allow up to 4 text lines 
            for (int r = 0; r < sftTree1.Headers.Rows; ++r) {
                cell = sftTree1.Headers[r, 1];
                cell.MergeWithLower = BoolOptionalEnum.True;
                cell.AllowMergeFromUpper = BoolOptionalEnum.True;
                cell.Parts.Clear();
            }
            TextPartClass tp = new TextPartClass("Vertical");
            tp.Format |= StringFormatFlags.DirectionVertical;
            sftTree1.Headers[0, 1].Parts.Add(tp);
            sftTree1.Headers[0, 1].Parts.Add(new ImagePartClass(img));
            tp = new TextPartClass("Cell merging in\na column header");
            sftTree1.Headers[0, 1].Parts.Add(tp);

            // Horizontally merge column header cells in row 1, columns 3 + 4
            sftTree1.Headers[1, 3].MergeWithNext = BoolOptionalEnum.True;

VB.NET

    sftTree1.Headers.MaxLines = 4 ' allow up to 4 text lines 
    For r As Integer = 0 To sftTree1.Headers.Rows - 1
        cell = sftTree1.Headers(r, 1)
        cell.MergeWithLower = BoolOptionalEnum.True
        cell.AllowMergeFromUpper = BoolOptionalEnum.True
        cell.Parts.Clear()
    Next
    Dim tp As TextPartClass = New TextPartClass("Vertical")
    tp.Format = tp.Format Or StringFormatFlags.DirectionVertical
    sftTree1.Headers(0, 1).Parts.Add(tp)
    sftTree1.Headers(0, 1).Parts.Add(New ImagePartClass(img))
    tp = New TextPartClass("Cell merging in" & vbCrLf & "a column header")
    sftTree1.Headers(0, 1).Parts.Add(tp)

    ' Horizontally merge column header cells in row 1, columns 3 + 4
    sftTree1.Headers(1, 3).MergeWithNext = BoolOptionalEnum.True

See Also TextPartClass Class | Classes | SftTree/NET 2.0