Hi.
I’m trying to create a diagram (GoDiagram v.4.2, C#, ASP.NET).
This is my code to create a node:
public class GoDiagramNode : GoTextNode
{
public GoDiagramNode(Holding info) : base()
{
this.TopLeftMargin = new SizeF(10,10);
this.BottomRightMargin = new SizeF(10,10);
this.Text = " " + info.HolderName + " ";
this.ToolTipText = info.HolderName;
this.AutoResizes = false;
this.Label.Clipping = true;
this.Label.StringTrimming = StringTrimming.EllipsisCharacter;
this.Location = new PointF(100,100);
this.Bounds = new RectangleF(this.Location, new SizeF(100, 40));
this.Backgroung = new GoRoundedRectangle();
}
}
And I have small circle with no text in it instead of rounded rectangle.
If I comment out last line
//this.Backgroung = new GoRoundedRectangle();
it works perfectly - but rectangle is not rounded.
If I comment out
//this.AutoResizes = false;
I have rounded rectangle - but size is not fixed.
Am I doing somethin wrong or this is a bug?
—Yuriy—
I think it’s small because the default size for the new GoRoundedRectangle is 10x10, and you have already set AutoResizes to false and haven’t explicitly set it to the size that you want.
Try setting the Background property first, or at least before you set AutoResizes, since that (naturally) affects whether the Background is resized or not in LayoutChildren.
Thank you.
It helped.