Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Conditional use of different class of buttons
Message
De
17/01/2008 12:56:25
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
À
17/01/2008 08:09:10
Jay Johengen
Altamahaw-Ossipee, Caroline du Nord, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Versions des environnements
Visual FoxPro:
VFP 8 SP1
Divers
Thread ID:
01282516
Message ID:
01282689
Vues:
20
>I'm using MyImageButtonClass, but want to use MyTextButtonClass based on the value of a property on the form. How do I do that? Do I make one invisible? That seems clunky. What would be the right way to handle it? Thanks!

There's no right way but then every way is right until you find a better one.

My trick for some cases of delayed instantiation was to have a placeholder object, usually a shape, which would do what its name says. Then when actually instantiating the actual object I wanted, I'd pass the shape as parameter to its .init(), so it would take the position and size from it. Then I'd kill the shape - which was simple when I did this from shape's .init(), I'd simply return .f. and the shape will never have existed. If I'd have to do it later, then I'd have to hide the shape when done, or .removeobject() it or just set it .visible=.f. - whichever works.

The reason for this is that there's only one object at design time to take care of, giving me quite a good idea of how it will look.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform