Node with a collapsable note

My goal is a Node with toggled visible note text. I’m not sure this is the best approach, but this seemed like it should be a good approach…

I’m using NodeLinkDemo45’s InfoText object.

It has a Group with a GoRectangle, GoText, GoButton, and GoText.

I hooked into the GoButton’s event, to toggle the 2nd GoText in and out of the group:
<br /> GoText _infot2 = new GoText(); // the 2nd GoText<br /> bool _infoVis = true;<br /><br /> private void button_Action(object sender, GoInputEventArgs e)<br /> {<br /> GoGroup group = this.Body as GoGroup;<br /> if (_infoVis)<br /> {<br /> group.Remove(_infot2);<br /> }<br /> else<br /> {<br /> group.Add(_infot2);<br /> }<br /> _infoVis = !_infoVis;<br /> this.LayoutChildren(_infot2);<br /> }<br />

But each time I remove and restore, the box the 2nd text is in shrinks.

Is there a better way or an easy way to maintain the expanded box size?

Sorry for the slow reply. Just getting back from New Year’s break. Looking at this now…

OK… that’s a bit too simplistic to work for you… more related to that sample class you started

with than anything.

Can you post pics of what you want the node to look like with and without the extra text?