Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to determine height required by data in an edit box
Message
De
07/03/2003 17:07:18
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00762425
Message ID:
00763064
Vues:
20
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.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform