Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
LockScreen=.T. affects some properties
Message
From
06/10/1997 19:07:55
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00053320
Message ID:
00053467
Views:
29
>Use the TextWidth() property of the form object to determine the width of your string...

Thanks a lot, here's what I did in order to make sure TextWidth() is working with the same font as the current control.
* This is a workaround bug
* Once the first call to this method, when LockScreen=.T.,
* the value returned by This.User.Width will be the same
* as before we changed the caption
IF This.lFirst
   This.lFirst=.F.
   LOCAL lcFont,lnFontSize
   lcFont=ThisForm.FontName
   lnFontSize=ThisForm.FontSize
   ThisForm.FontName=This.User.FontName
   ThisForm.FontSize=This.User.FontSize
   This.User.Caption=ALLTRIM(tcPrenom)+' '+ALLTRIM(tcNom)
   This.User.Width=ThisForm.TextWidth(This.User.Caption)
   ThisForm.FontName=lcFont
   ThisForm.FontSize=lnFontSize
ENDIF
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Previous
Reply
Map
View

Click here to load this message in the networking platform