Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Stupid label question
Message
De
12/11/1998 19:28:20
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00155701
Message ID:
00157242
Vues:
78
>The code fragment you posted used AddObject() so it had to be set .t.

That code is from MSDN, as an example on how to get the GPF. You are right about Visible. But if Visible is set to .t. before setting AutoSize AND Wordwrap to .t., it works ok.

>I do believe it can occur with a label put on a form in the designer, so it's .Visible isn't explicitly set .t., Although I guess internally VFP may be doing AddObject() and setting .Visible = .t. as it constructs a form

Yes, this is done before form's Init. So, unless it's a label of a class that has Visible = .f. by default, everything should work.

>But anyway AutoSize and WordWrap really are mutually exclusive features.

Why? WordWrap wraps the words in the horizontal space of the label. Autosize fits the height of the word-wrapped label. True, this is not the behavior specified in the Help, but this is how it really works.

My feeling is that this thread is already a little too long for its subject. I just wanted to point out that this behavior can be useful when used carefully. Given that it's not as documented and that it's somehow risky, I wouldn't recommend it. Probably your solution is better. The only thing I don't like is that a label is simulated. When this is done in a framework, it introduces some anomalies in that framework, etc.

On the other hand, this is a good example for how useful can be the accessor functions (as in VFP6). For a bug like that, it's very easy to rewrite the corresponding set function and have everything safe with only a few lines of code.

From the projects I've worked lately in other languages (C++ and Java), I start to believe that the accessor functions are one of the best thing that can "happen" to a project. Practically, having them can cut the programming effort by 5-100 times for specific tasks. And they are invaluable at testing/maintenance time.

Vlad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform