// 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);
}