Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to determine height required by data in an edit box
Message
From
07/03/2003 17:07:18
 
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00762425
Message ID:
00763064
Views:
21
I used the following code to get a start. I may have to refine the constants once I get more data into the tables, but with my test data it works pretty well.
With &lcThisBody
  if ! empty(&lcPaperBody)
    .visible = .t.
    .top = lnLoc
    .value = &lcPaperBody
    .width = 700
    alines(lcalines,&lcPaperBody)
    lnLineCount=0
    for j = 1 to alen(lcAlines)
      lnLineCount = lnLineCount + ;
        int(txtwidth(lcAlines(j),"Arial",12,"N")/65) + 1	
    next J
    .height = fontmetric(1,'Arial',12,'N') * lnLineCount
      lnLoc = lnLoc + .height + 5
    else
      .visible = .f.
  endif
endwith
Thanks for all your ideas.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform