Dynamic text alignment on a memo in Script

LorenzLorenz London
edited 11:43AM in FastReport 4.0
Hi

I't trying to do dynamic text alignment on a memo from the OnAfterData event.
I have got the style changing but cannot get the alignement working

Please does anyone know how ?

procedure Memo3OnAfterData(Sender: TfrxComponent);
var
aFormat:string;                                      
begin
 aFormat:=copy(memo3.value,1,2);           

 memo3.text:=copy(memo3.value,3,42);//+'-'+aFormat;     

 if Aformat='06' then memo3.font.style:=fsbold else  memo3.font.style:=0;
 { here is the values
frConsts['fsBold'] := 2;
frConsts['fsItalic'] := 1;
frConsts['fsUnderline'] := 4;
frConsts['fsStrikeOut'] := 8;}       
     
// ****************   This Does not appear to work ? ****************
  
// if Aformat='05' then memo3.frame.HAlign:=haCenter else memo3.frame.HAlign:=haLeft;
  
// ****************   This Does not appear to work ? ****************    
  
     

end;

Keywords

Script Dynamic Memo Align Frame Haleft HaCenter HAlign


Any Help much appreaciated. [img]style_emoticons/<#EMO_DIR#>/wink.gif" style="vertical-align:middle" emoid=";)" border="0" alt="wink.gif" /> Lorenz[/img]

Comments

  • gpigpi
    edited 11:43AM
    Try to use
    if Aformat='05' then memo3.HAlign:=haCenter else memo3.HAlign:=haLeft;

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.