GoDigram for .NET Framework and .NET Core
Northwoods.Go Namespace / GoMultiTextNode Class / CreateText Method
Example
In This Topic
    CreateText Method
    In This Topic
    Create and initialize a text item given a string.
    Syntax
    public virtual GoText CreateText( 
       string s,
       int idx
    )

    Parameters

    s
    idx

    Return Value

    a GoText object that is the new item
    Remarks
    Note that the width of the text object is not set unless ItemWidth is a positive value.
    Example
    If you override this method, you may want the definition to do some of the things that the standard definition does:
    public virtual GoText CreateText(String s, int idx) {
      GoText t = new GoText();
      t.Selectable = false;
      t.Alignment = GoObject.Middle;
      t.Multiline = true;
      t.BackgroundOpaqueWhenSelected = true;
      t.BackgroundColor = Color.LightBlue;
      t.DragsNode = true;
      t.Text = s;
      t.Wrapping = true;
      if (this.ItemWidth > 0) {
        t.WrappingWidth = this.ItemWidth;
        t.Width = this.ItemWidth;
      }
      return t;
    }
    See Also