I am adding text boxes to existing charts in a file I load. This works OK, but unless I missing something else I need to set, it seems that the IShapeProperties.TextFlags does not have any effect. The source indicates being able to use bit mask to centre text horizontally and vertically. Whatever I set the flags to seem leaves the text in the box top-left justified.
ShapeOptions1 := TShapeProperties_Create;
ShapeOptions1.Anchor := TClientAnchor.Create(true, TFlxAnchorType.MoveAndResize, 2693, 0, 2251, 0, 2889, 0, 2942, 0);
ShapeOptions1.ShapeType := TShapeType.Rectangle;
ShapeOptions1.ObjectType := TObjectType.Text; // or TObjectType.MicrosoftOfficeDrawing
ShapeOptions1.ShapeName := 'TextBox 1';
ShapeOptions1.TextFlags := $223; //$212 = Top left. This doesn't seem to work
//whatever I set seems to be Top Left
ShapeOptions1.Text := 'NIMHR346 Sample D6';
ShapeOptions1.RotateTextWithShape := true;
ShapeOptions1.ShapeThemeFont := TShapeFont_Create(TFontScheme.Minor, TDrawingColor.FromSystem(TSystemColor.WindowText));
ShapeOptions1.Print := true;
ShapeOptions1.Visible := true;
ShapeOptions1.ShapeOptions.SetValue(TShapeOption.wzName, 'TextBox 1');
Chart1.AddAutoShape(ShapeOptions1);
Am I not doing something right, or is this not working right now?
Thanks