@bingxie,
With Aspose.Slides 23.2, please try using the following test code example:
string presPath = "newpresentation.pptx";
// create a new presentation from scratch
using (Presentation pres = new Presentation())
{
ISlide slide = pres.Slides[0];
IAutoShape shape1 = slide.Shapes.AddAutoShape(ShapeType.Rectangle, 10, 10, 50, 20);
// Assert.False(shape1.IsTextBox); // here IsTextBox must be false
shape1.TextFrame.Text = "Shape with text"; // just set Text value
// Assert.True(shape1.IsTextBox); // here IsTextBox must be true
pres.Save(presPath, SaveFormat.Pptx);
}
// reopen the presentation
using (Presentation pres = new Presentation(presPath))
{
ISlide slide = pres.Slides[0];
IAutoShape shape1 = (IAutoShape)slide.Shapes[0];
// Assert.True(shape1.IsTextBox); // here IsTextBox must be true
}