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
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
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.
Thanks anyway
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?
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