Placing Icon over the Link and it's Movement

Dear ,

We have the facility to place an image over GoLabeledLink along with MidLabel. We are placing the icon using this code:
private GoObject LinkFigure { set { Remove(myLinkFigure); myLinkFigure = value; myLinkFigure.Size = new SizeF(26.5F, 26.5F); myLinkFigure.SetSpotLocation(MiddleRight, this.MidLabel, MiddleLeft, new SizeF(-4, 0)); myLinkFigure.Selectable = false; myLinkFigure.Resizable = false; Add(myLinkFigure); } }
the icon is comming fine over the link but the problem is, when the link is shifted from it's original location to new location the Icon is not moving with the link.see..
What we want is, the Icon should be movable with link like MidLabel.
Thanks

Just use MidLabel for your object. It MidLabel can be any GoObject.

myLink.MidLabel = myLinkFigure;
is all you need.

Dear Jake,

we are using ToLabel,MidLabel and FromLabel to display other info that is why we are making group. so please give me the solution from above written code.
T

You need to override LayoutChildren, call the base.LayoutChildren, and then position your icon.

The other option would be to make a GoGroup out of the icon and label you do have, and then make that GoGroup the MidLabel. That's actually probably easier, as you don't have to figure out how to position at the midpoint.