GoDigram for .NET Framework and .NET Core
Northwoods.Go Namespace / GoSubGraph Class / LayoutLabel Method
In This Topic
    LayoutLabel Method (GoSubGraph)
    In This Topic
    This positions the Label within the group, according to the LabelSpot or CollapsedLabelSpot.
    Syntax
    public virtual void LayoutLabel()
    Remarks

    When the LabelSpot refers to a corner, the Label is actually positioned above or below the subgraph, much like headers or footers in a page layout. Furthermore, when the LabelSpot is TopLeft, if there is a Handle and it is at exactly the same position, the label is shifted right to avoid the overlap. If this node is not IsExpanded, the label is positioned according to the CollapsedLabelSpot. If there is a CollapsedObject the label is positioned relative to that collapsed object; otherwise it is positioned relative to the result of ComputeCollapsedRectangle.

    You can override this method to locate the label in customized places. But note that the default behavior of ComputeInsideMarginsSkip is to include the Label in the background/border decoration as computed by ComputeBorder. If you want the label to be positioned outside of the border decoration, you will need to override ComputeInsideMarginsSkip as follows:

    
                protected override bool ComputeInsideMarginsSkip(GoObject child) {
                  if (child == this.Label && this.IsExpanded) return true;
                  return base.ComputeInsideMarginsSkip(child);
                }
                
    This example override will cause the Label not to necessarily be inside the border when the subgraph is expanded.

    See Also