Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Conditional use of different class of buttons
Message
From
17/01/2008 12:56:25
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
17/01/2008 08:09:10
Jay Johengen
Altamahaw-Ossipee, North Carolina, United States
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Environment versions
Visual FoxPro:
VFP 8 SP1
Miscellaneous
Thread ID:
01282516
Message ID:
01282689
Views:
19
>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.
Previous
Reply
Map
View

Click here to load this message in the networking platform