We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

How to reduce margins around label in node, so the label would not wrap?

 I have a label inside of a node. The label is shorter than a node. Still the label is wrapped inside of the node, though visually it should fit.
How to reduce the margins around label inside of the node, so it would not wrap.
Don't suggest to use Label.WrapText =false as this will stop from wrapping long labels too.
See the screenshot for details.
Also some code here:
Thank you

var shape = new Syncfusion.Windows.Forms.Diagram.Rectangle(0, 0, _discoverySettings.TaskWidth, _discoverySettings.TaskHeight, MeasureUnits.Millimeter);
            shape.FillStyle.Color = System.Drawing.Color.LightGreen;
            Syncfusion.Windows.Forms.Diagram.Label lbl = new Syncfusion.Windows.Forms.Diagram.Label();
            lbl.Text = name;
            lbl.FontStyle.Size = _discoverySettings.TaskFontSize;
            //lbl.WrapText = false;
            shape.PinPoint = new PointF(x, y);

Attachment: node_label_margin_d2701949.zip

3 Replies

SK Swarnesh Krishna Kumar Syncfusion Team January 14, 2015 06:46 AM UTC

Hi Tagir,

Thanks for using Syncfusion products.

We are afraid that we are not able to reproduce the reported issue in our side. Could you please provide us more information probably your sample or code to reproduce the reported issue?

Here is the Sample:


Let us know if any concern


Swarnesh K

TA Tagir January 14, 2015 08:47 AM UTC

Hello Swarnesh!
 Sorry I have to be more specific in the code.
I have attached a screenshot I get with this code.
Here is the code to try:
var shape = new Syncfusion.Windows.Forms.Diagram.Rectangle(0, 0, 20, 7, MeasureUnits.Millimeter);

            shape.FillStyle.Color = System.Drawing.Color.LightGreen;
            Syncfusion.Windows.Forms.Diagram.Label lblt = new Syncfusion.Windows.Forms.Diagram.Label();
            lblt.Text = "JOBS1";
            lblt.FontStyle.Size = 6;
            //lbl.WrapText = false;

            shape.PinPoint = new PointF(30, 100);

Attachment: node_label_margin2_de05d522.zip

SK Swarnesh Krishna Kumar Syncfusion Team January 19, 2015 11:56 AM UTC

Hi Tagir,

Thanks for your interest in Syncfusion product.

We have analyzed the reported problem and we suspect this could be an issue. Please create an incident on behalf of this reported problem from the following link for better assistance.

Here is the link: link

Please let us know if you have any concerns.


Swarnesh K


Live Chat Icon For mobile
Up arrow icon