Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using Autosize programmatically
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00120363
Message ID:
00120675
Views:
23
Bruce,

Try this though. Have a label subclass where the subclass set AutoSize=.t. (I do this in my lowest level cLabel subclass). Drop one of them on a form and set it's caption to "this is a long caption".

In the Init() and Click() of a label subclass instance and the Init(), Acitvate() and Click() of the form put this:

debugout program() + str( thisform.cLabel1.Width )

and watch what happens in the output window. You'll see that at Init() time of the label it's width is like 40, then changes.

>>I am using it with ScreenLock on, so no jumping, but I have had to resort to multiplying the TXTWIDTH of the caption by FONTMETRIC(6) to get the Width.
>
>Something's not right here...create a little test form with, say, 1 label and 2 buttons, autosize = .t. on label. In each button, change the label caption to a different length string in the click event. You should see the autosize working fine...
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform