Search
ShapeNode.ResizeToFitText Method
See Also
 





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

Namespace: MindFusion.Diagramming
Assembly: 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, or false otherwise.

 Example

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

C#  Copy Code

var r = new Rect(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