GoDigram for .NET Framework and .NET Core
Northwoods.Go Namespace / GoSubGraph Class / LayoutHandle Method
Example
In This Topic
    LayoutHandle Method
    In This Topic
    This positions the handle within the group.
    Syntax
    public virtual void LayoutHandle()
    Remarks
    By default this places the handle at the top left corner of the group, inside the margin. This method does nothing if the node is not IsExpanded.
    Example
    To place the handle in the margin at the top-left corner, rather than the default position inside the margins: For more examples, see the classes in the SubGraphApp sample.
    public override void LayoutHandle() {
      if (!this.IsExpanded) return;
      GoSubGraphHandle h = this.Handle;
      if (h != null) {
        RectangleF b = ComputeBorder();
        // top-left, in the margins
        h.Position = new PointF(b.X, b.Y);
      }
    }
    // To place the handle at the top-right corner, you could implement these overrides:
    public override void LayoutHandle() {
      if (!this.IsExpanded) return;
      GoSubGraphHandle h = this.Handle;
      if (h != null) {
        RectangleF b = ComputeInsideMargins(null);
        // top-right, inside margin
        h.SetSpotLocation(TopRight, GetRectangleSpotLocation(b, TopRight));
      }
    }
                
    // Make sure the collapsed subgraph body (including any CollapsedObject)
    // is positioned to the left of the handle.
    protected override RectangleF ComputeCollapsedRectangle(SizeF s) {
      PointF hpos = ComputeReferencePoint();
      return new RectangleF(hpos.X + this.Handle.Width - s.Width, hpos.Y, s.Width, s.Height);
    }
    See Also