Maybe you just want to position the Label yourself, putting it relative to the Handle rather than relative to the contents of the subgraph.
[Serializable] public class TestSubGraph5 : GoSubGraph { public TestSubGraph5() { } public override void LayoutLabel() { base.LayoutLabel(); GoText lab = this.Label; GoSubGraphHandle h = this.Handle; if (lab != null && h != null) { PointF pt = h.GetSpotLocation(TopRight); pt.X += 3; // add some space between the Handle and the Label lab.SetSpotLocation(TopLeft, pt); } } }
Thanks for the help bu unfortunately the subgraph still doesn’t function as it should:
when i move items inside the subgraph to the right the boarder doesn’t resize properly (the left side of the bounds rectangle doesn’t move to the right). - I guess that this has happened because we have repositioned the label relatively to the handle which wasn’t repositioned yet.
The handle still hides the label. it is only after i collapse and then expand that the label moves.
can anyone help?
I don’t see why moving a subgraph item to the right should move the left side of the border, unless that item had been on the left side to begin with. Nor, with the overridden implementation of LayoutLabel, do I see why it matters that the label hadn’t been laid out yet.
You can always call that LayoutLabel method explicitly when you are done initializing the node.