ASP.NET Pack Programmer's Guide
ShapeNode.ResizeToFitText Method
See Also
 





Makes the shape node big enough to display its text without clipping.

Namespace: MindFusion.Diagramming
Package: MindFusion.Diagramming

 Syntax

C#  Copy Code

public bool ResizeToFitText (
    FitSize fit
)

Visual Basic  Copy Code

Public Function ResizeToFitText( _
    fit As FitSize _
) As Boolean

 Parameters

fit
A member of the FitSize enumeration specifying whether the width or height of the node should remain unchanged.

 Return Value

true if the node is resized successfully; otherwise, false.

 Example

The following sample resizes a node to fit its text, using 1:1 width to height ratio.

C#  Copy Code

r = new RectangleF(shapeNode.Bounds.Left, shapeNode.Bounds.Top, 10, 10);

shapeNode.PolygonalTextLayout = true;
shapeNode.Bounds = r;
shapeNode.Text = "the method changes both the box' width" +
    "and height, maintaining their original ratio.";
shapeNode.ResizeToFitText(FitSize.KeepRatio);

Visual Basic  Copy Code

r = New RectangleF(shapeNode.Bounds.Left, shapeNode.Bounds.Top, 10, 10)

shapeNode.PolygonalTextLayout = True
shapeNode.Bounds = r
shapeNode.Text = "the method changes both the box' width" + _
    "and height, maintaining their original ratio."
shapeNode.ResizeToFitText(FitSize.KeepRatio)

 See Also

ShapeNode Members
ShapeNode Class
MindFusion.Diagramming Namespace
Text Property
ResizeToFitImage Method