Hide

SftTree/NET 2.0 - Tree Control for Windows Forms

Display
Print

LineStyleEnum Enumeration

Defines attributes of a text string.

Class: (none)
Namespace: Softelvdm.Controls
Assembly: Softelvdm.SftTreeNET

Syntax

public enum LineStyleEnum;
Public Enum LineStyleEnum

Values

NameDescription
NoWrapThe text will not wrap around and use only explicit line breaks.
WordwrapThe text will automatically word-wrap and allows explicit line breaks.

Comments

Defines attributes of a text string.

Examples

C#

            // that is located on your system.
            Image img = Bitmap.FromFile("..\\..\\test.gif");

            // Add an item
            ItemClass item = sftTree1.ItemCollection.Add();

            // Add a text part to the first cell (could use CellBaseClass.Text instead)
            CellClass cell = item.Cells[0];
            TextPartClass tp = new TextPartClass("The first cell", LineStyleEnum.Wordwrap, HAlignmentOptionalEnum.Left,
                         VAlignmentOptionalEnum.Top, Color.Blue, Color.Green, Color.Red, Color.Blue, new Font("Arial", 12), StringFormatFlags.LineLimit| StringFormatFlags.MeasureTrailingSpaces); 
            cell.Parts.Add(tp);
            // Followed by a check box (still in the first cell)
            CheckBoxPartClass cb = new CheckBoxPartClass( CheckBoxStateEnum.Unchecked, HAlignmentOptionalEnum.Left, VAlignmentOptionalEnum.Top, true);
            cb.Action += new GenericPartClass.ActionEventHandler(cb_Action);
            cell.Parts.Add(cb);
            // Followed by an image (still in the first cell)

VB.NET

    ' that is located on your system.
    Dim img As Image = Bitmap.FromFile("..\\..\\test.gif")

    ' Add an item
    Dim item As ItemClass = sftTree1.ItemCollection.Add()

    ' Add a text part to the first cell (could use CellBaseClass.Text instead)
    Dim cell As CellClass = item.Cells(0)
    Dim tp As TextPartClass = New TextPartClass("The first cell", LineStyleEnum.Wordwrap, HAlignmentOptionalEnum.Left, _
             VAlignmentOptionalEnum.Top, Color.Blue, Color.Green, Color.Red, Color.Blue, New Font("Arial", 12), StringFormatFlags.LineLimit Or StringFormatFlags.MeasureTrailingSpaces)
    cell.Parts.Add(tp)
    ' Followed by a check box (still in the first cell)
    Dim cb As CheckBoxPartClass = New CheckBoxPartClass(CheckBoxStateEnum.Unchecked, HAlignmentOptionalEnum.Left, VAlignmentOptionalEnum.Top, True)
    AddHandler cb.Action, AddressOf cb_Action
    cell.Parts.Add(cb)
    ' Followed by an image (still in the first cell)

See Also | Classes | SftTree/NET 2.0