Exception in Paint

I also have a similar problem but the message is quite diferent.
It gives me this error:
OnPaint: System.InvalidOperationException: Collection was modified; enumeration operation may not execute.
at System.Collections.ArrayListEnumeratorSimple.MoveNext()
at Northwoods.Go.GoLayer.Paint(Graphics g, GoView view, RectangleF clipRect)
at Northwoods.Go.GoView.PaintObjects(Boolean doc, Boolean view, Graphics g, RectangleF clipRect)
at Northwoods.Go.GoView.PaintView(Graphics g, RectangleF clipRect)
at Northwoods.Go.GoView.onPaintCanvas(PaintEventArgs evt)
at Northwoods.Go.GoView.OnPaint(PaintEventArgs evt)
Some info:
Im extending the GOTextNode class and made an IconicNode innerclass so I could use the features of both nodes. In that class, I overrided the Paint Method to set the iconic node in the same position of my node, but Im not using the Base.Paint() method.

Implementations of the GoObject.Paint method must NOT modify any objects, neither in the document nor in the view.

Thank you Walter…
Do you know about any turn arounds for my implementation?

I don’t understand what you did.
It seems to me if you want to have a GoTextNode that displays an image and an additional text string and has an extra port, you could just replace the GoTextNode.Background object to be an instance of a GoIconicNode.
If you want a GoTextNode that just displays an image, but you don’t need an extra GoText or an extra GoPort, you could just set the GoTextNode.Background to be an instance of a GoImage (perhaps a GoNodeIcon).
None of these possibilities requires any derived classes or nested classes or overriding any methods. But it might be convenient to put the GoTextNode.Background initializing code in an override of GoTextNode.CreateBackground.

My Goal is to position the iconicnode in the same position as the TextNode.
Any help?

You didn’t say which of the several alternatives you wanted.
What happens when you try it?

I’ve tried the first option but it gives me an error saying that there’s a limit of 6 nested objects.

Ah, you’re using GoDiagram Express, which doesn’t support all the complexities of general groups of objects.
But with GoDiagram Express you can still set the GoTextNode.Background to be a GoImage, if that’s the effect you want.

That’s true…
What I really need is to have an IconicNode with two ports. Is that possible with this version of the software?

Yes, I believe so. Create a GoTextNode, set the Text, set two of the ports to null, set the properties of the other two ports the way you want, and set the Background to an instance of GoImage.
You’ll probably need to set AutoResizes to false, so that when you modify the Text string it doesn’t resize the Background–i.e. your image-- to fit around the text.
And as I mentioned earlier, you need to put all of that initialization code somewhere, so you might as well put it all into a class inheriting from GoTextNode. Some of the code would most naturally go into the constructor; some would go into overrides of Create… methods, and some might go into a new initialization method that you define so that you can figure out which image to display in the GoImage that is the new GoTextNode.Background object.

I’m doing some tests on your sugestions and I’ll let you know if I succeeded.
Thanks a lot for you help!