Hide

SftTree/NET 2.0 - Tree Control for Windows Forms

Display
Print

Text Property, CellBaseClass Class

Defines the text of the first TextPartClass object found in the cell's parts collection.

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

Syntax

public string Text { get; set; }
Public Property Text As String

Value

The text of the first TextPartClass object.

The default value is String.Empty.

Comments

Defines the text of the first TextPartClass object found in the cell's parts collection.

If an application uses only one TextPartClass and one ImagePartClass object in each cell, it can access their contents directly using the CellBaseClass.Text and CellBaseClass.Image properties, instead of having to "remember" which object in the parts collection is the respective object. In addition, the CellBaseClass.TextPart and CellBaseClass.ImagePart properties are available to access these object. When text is assigned to the CellBaseClass.Text property, a TextPartClass object is automatically added to the cell's parts collection, if one has not yet been added.

Examples

C#

            Debug.Print("We're starting to drag something");
            DumpValues(e);

            // based on what we are dragging, make up a string
            string s = "";
            s = e.Area.ToString() + " in ";
            s += e.Item.UsageLocation.ToString() + ": ";
            if (e.Cell != null) {
                if (e.Cell.Text == "") s += "(empty cell) ";
                else s += e.Cell.Text + " ";
            } else if (e.RowHeader != null) {
                if (e.RowHeader.Text == "") s += "(empty row header) ";
                else s += e.RowHeader.Text + " ";
            } else if (e.Item != null) {
                s += " an item ";
            }

VB.NET

    Debug.Print("We're starting to drag something")
    DumpValues(e)

    ' based on what we are dragging, make up a string
    Dim s As String = ""
    s = e.Area.ToString() & " in "
    s = s & e.Item.UsageLocation.ToString() & ": "
    If Not e.Cell Is Nothing Then
        If e.Cell.Text = "" Then
            s = s & "(empty cell) "
        Else
            s = s & e.Cell.Text & " "
        End If
    ElseIf Not e.RowHeader Is Nothing Then
        If e.RowHeader.Text = "" Then
            s = s & "(empty row header) "

See Also CellBaseClass Class | Classes | SftTree/NET 2.0