Articles


If you want to align a text,you can find some properties.HAlignment property can set horizontal alignment.VAlignment property can set vertical alignment.WordWrap property

Set WordWrap to true to allow the text to display multiple line of text.When WordWrap is true,text that is too wide for the outer rectanger control wraps at the right margin and continues in additional lines.Set WordWrap to false to limit the label to a single line. When WordWrap is false, text that is too wide for the uter rectanger appears outside.

Also,you can set value by code.

Code example:

procedure TMainFrm.Button1Click(Sender: TObject); 
begin 
  if (MyCAD1.GetSelectedShape<>nil) and (MyCAD1.GetSelectedShape is TMyText) then 
  begin 
    TMyText(MyCAD1.GetSelectedShape).HAlignment:=taCenter; 
    TMyText(MyCAD1.GetSelectedShape).VAlignment:=vaTop; 
    TMyText(MyCAD1.GetSelectedShape).WordWrap:=true; 
  end; 
end;