What Component i sould use to display a Rectangle with a text in it. The rectangle should habe a defined size
One possibility is to use a GoTextNode that has its AutoResizes property set to false, so that you can set the GoTextNode.Background.Size to whatever you want. You may also want to set the GoTextNode.TopLeftMargin and .BottomRightMargin properties, to adjust the size of the space around the Label inside the Background.
thx for the fast feedback - and how can i combine this GoTextNode with a GoTriangle or GoRectangle.
My goal is to place such Rectangle or Triangle on the Screen with a fixed size. The Text should be placed into it
GoTextNode tn = new GoTextNode();
tn.Text = "some text";
tn.TopLeftMargin = new SizeF(20, 35);
tn.BottomRightMargin = new SizeF(20, 5);
GoTriangle tri = new GoTriangle();
tri.Resizable = false;
tri.A = new PointF(0.5f, 0);
tri.B = new PointF(0, 1);
tri.C = new PointF(1, 1);
tn.Background = tri;
tn.AutoResizes = false;
doc.Add(tn);
tn.Text = "some text";
tn.TopLeftMargin = new SizeF(20, 35);
tn.BottomRightMargin = new SizeF(20, 5);
GoTriangle tri = new GoTriangle();
tri.Resizable = false;
tri.A = new PointF(0.5f, 0);
tri.B = new PointF(0, 1);
tri.C = new PointF(1, 1);
tn.Background = tri;
tn.AutoResizes = false;
doc.Add(tn);
Of course you can customize the GoTriangle to be the shape and colors you want it to be. Depending on the shape and the amount of text, you may need to adjust the ...Margin properties correspondingly.
great thx you!