[Serializable] public class SubroutineShape : GoRectangle { public SubroutineShape() { } public override void Paint(Graphics g, GoView view) { base.Paint(g, view); RectangleF b = this.Bounds; float d = 10; if (b.Width < 30) d *= b.Width/30; GoShape.DrawLine(g, view, this.Pen, b.X+d, b.Top, b.X+d, b.Bottom); GoShape.DrawLine(g, view, this.Pen, b.Right-d, b.Top, b.Right-d, b.Bottom); } }
You'll also need to increase the margins for the GoTextNode, so that the extra lines drawn by the SubroutineShape don't overlap the text:
textnode.TopLeftMargin = new SizeF(14, 4);
textnode.BottomRightMargin = new SizeF(14, 4);
If you already have a subclass of GoTextNode defined, it would be more efficient to override GoTextNode.CreateBackground, rather than setting the GoTextNode.Background property: