how to change shape's text?

Feb 17, 2012 at 6:01 AM

dynamic monitor application ,how to chang shape‘s text?for example ,a box’s text .

Feb 17, 2012 at 6:59 AM
Edited Feb 17, 2012 at 6:59 AM
  • Cast the shape to a suitable class that has a text property, e.g. Box, RectangleBase or CaptionedShape:
    Box box = (Box)shape;
    box.Text = "New Text";
  • Use the ICaptionedShape interface that all shapes with text implement:
    ICaptionedShape captonedShape = (ICaptionedShape)shape;
    captionedShape.SetCaptionText(0, "New Text");

Best Regards,

Feb 18, 2012 at 3:59 AM