GoDigram for .NET Framework and .NET Core
Northwoods.Go Namespace / GoGeneralNode Class / CreateLabel Method
a null value causes no label to be allocated
Example
In This Topic
    CreateLabel Method (GoGeneralNode)
    In This Topic
    Create and initialize a text label for either the top or the bottom.
    Syntax
    protected virtual GoText CreateLabel( 
       bool top,
       string text
    )

    Parameters

    top
    text
    a null value causes no label to be allocated

    Return Value

    an editable, non-selectable, middle-aligned, non-rescaling GoText object
    Example
    If you override this method, you may want the definition to do some of the things that the standard definition does:
    protected virtual GoText CreateLabel(bool top, String text) {
      GoText l = null;
      if (text != null) {
        l = new GoText();
        l.Text = text;
        l.Selectable = false;
        if (this.Orientation == Orientation.Vertical) {
          if (top)
            l.Alignment = MiddleRight;
          else
            l.Alignment = MiddleLeft;
        } else {
          if (top)
            l.Alignment = MiddleBottom;
          else
            l.Alignment = MiddleTop;
        }
        l.Editable = true;
        this.Editable = true;
      }
      return l;
    }
    See Also