Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using Autosize programmatically
Message
 
 
To
23/07/1998 07:25:47
Rex Mahel
Realm Software, Llc
Ohio, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00120363
Message ID:
00120571
Views:
20
Rex,

There isn't much rhyme or reason to exactly when VFP updates the .Width of an AutoSize=.t. label. The label first instantiates with a .Width of the class, not the size that shows up on the property sheet. The .Width doesn't change until the first Form.Activate() (if I remember correctly that's when it happens). If you change the .Caption at runtime I'm not sure when .Width updates.

I've got a Label subclass that acts like a hyperlink. At Init() it adds an CommandButton that is set to Style = Invisible. In the GotFocus() of the button I have to adjust it's .Width to get the highlight to properly size itself around the Label.

>I have a label control with AutoSize = .T. I am setting the Caption property programmatically, but the width is not changing (as you might expect with AutoSize = .T.)
>
>Is AutoSize for interactive change only, or do I need to do something else to make it work.
df (was a 10 time MVP)

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

Click here to load this message in the networking platform