GoTextNode label positioning

I’m wondering if anyone can help me with a problem I’ve got as I can’t seem to find a solution…

I have a class derived from a GoTextNode which has a TopLeftMargin value so various images can be inserted before the Label. For my normal nodes this is fine.

However I need to create another type of Node, which resizes vertically via code when one of these images is clicked, but the Label must remain at the top of the Node.

I’ve currently got the Resizable, AutoRescales and AutoResizes properties of the label turned off. I don’t want it to be Resizable and both AutoRescales and AutoResizes prevent my images from appearing and hence make the image unclickable. With these turned off the Alignment property appears to not quite work (e.g. TopCenter will align center but not remain at the top).

I can set the Bounds of the label myself manually, but everytime the bounds of the box containing it change my label gets moved, and because the label is created via a GoTextNode.CreateLabel() I don’t believe there is a way I can override the Label.Bounds property…

If anyone has any suggestions that’d be great.

Cheers

You should look at DecoratedTextNode in Demo1. Nodes with non-trivial layout requirements typically override LayoutChildren to place the parts.

Jake,

Thanks for the response. I don’t actually have a DecoratedTextNode class in Demo1 as I’m using a slightly older version of GoExpress.

I have however managed to resolve the issue in a somewhat roundabout way. But in the process I have discovered the CollapsingRecordNode in the GoDiagram version which is almost identical to what I’m using/trying to implement, so thanks for the advice anyway.<span style=“font-size: 11pt; font-family: “Calibri”,“sans-serif”;”>

You may not be able to do what you want with GoExpress. There’s no way to add children, so I’m not sure how you’ve added the image, unless you’re doing it the way TriangleTextNode does (which is in Express).

You may be able to get what you want by using TopLeftMargin and BottomRightMargin…