TfrMemoView width

Hi,

I have Memo, wich text is changed at runtime. The Memo is AutoWidth and it realy change it's width depending from text. What I need it to get the Memo's width in build in script. "Memo.Width" returns the width, but this width is not changed when the text is changed at runtime. It always show the width set in designtime.
My question is how to get to get the width, calculated at runtime ?

Thanks in advance

Comments

  • edited April 2004
    If you want to set a FIXED with, I take it you have (obvious) changed the AutoWidth to False?!
    Else if you want to change the text in a memo (with AutoWidth True), try using Memo1.Lines[0]:='this is a long line of text'; in the memos' script window.
  • edited 10:12PM
    But I need it to be AutoWidth=True. What exactly I need is to place the memo at custom coordinates. The top coordinate should be the top of the memo, but the left coordinate should be the center of the memo. That's why I need the width - I need to calculate the "Memo.Left".
  • edited 10:12PM
    That's what I'm doing - I am changing the Memo1.Lines[0]:="bla bla bla" in the memos' script window, but the width doesn't change.
  • edited 10:12PM
    A quick workaround would be to bandalign the memo to baWidth and use the Center alignment.
  • edited 10:12PM
    If I do it so the memo will aways stay centered on the page ;)
    Thanks anyway
  • edited April 2004
    Its a bug/design feature...

    It looks like the AutoWidth is only used when displaying the text as the following script does exactly what you started the post with, ie. Width returns the design width and not the actual width.

    Memo1.AutoWidth:=False;
    Memo1.AutoWidth:=True;
    nCenter:=[PAGEWIDTH]-Memo1.Width;
    Memo1.Left:=nCenter/2;

    <ABOVE POST>
    I thought that is what you wanted to do; display a memo centered?
  • edited 10:12PM
    Yes, it looks like bug, maybe it will be fixed in the new versions. Thank you very much
  • gordkgordk St.Catherines On. Canada.
    edited 10:12PM
    Hi
    Try this make report 2pass, in script of memo which is in the same band,but processed after the memo in question, gather width info of memo in an array, then in obpevent of band use if finalpass statement to use the array value to calculate and set the memos position.
    regards ;)

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.