GoSubGraph Label

I’m trying to add a Label to a subgraph. I have already override the LayoutHandle method so that the +/- sign ignores the node margin.

Is there an easy to do this same thing for Lables? ... ignore the node margin, and maybe move it to the right a few pixels so it doesn't overlaps with the handle.

You can override LayoutLabel to do what you want. You can decide whether to depend on the results of ComputeInsideMargins or ComputeBorder.

If you are adding a label (or any other "special" objects) in addition to the standard GoSubGraph.Label, you may also need to override ComputeInsideMarginsSkip for that child object, so that the result of ComputeInsideMargins doesn't include that as-yet-unpositioned additional special child.

This is what I’ve tried…

public override void LayoutLabel()
GoText gt = this.Label;
if (gt != null && gt.CanView())
RectangleF b = ComputeBorder();
gt.Position = new PointF(b.Location.X + 10, b.Location.Y);
I place this code inside my CustomSubGraph.cs file - but it still doesn't seem to work. I basically want the Label to be right next to the handle (as in the example code provided for placing the handle at very top-left everytime, ignoring margins).
I also tried calling the LayoutLabel method from DoResize - with or without the call, still doesn't work.
Any ideas?

ohh, ok - for those interested; this is how i solved it. Walter is correct as usual - override ComputeInsideMarginSkip() method. Here is my example.

protected override bool ComputeInsideMarginsSkip(GoObject child)
GoText t = child as GoText;
if (t != null)
return true;
return base.ComputeInsideMarginsSkip(child);
Thanks Walter.:)