Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Change a bunch of baseclasses to a new class?
Message
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Environment versions
Visual FoxPro:
VFP 7 SP1
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01056173
Message ID:
01056178
Views:
18
This message has been marked as the solution to the initial question of the thread.
>Writing a wee multiplication tables app. for my daughter at home.
>
>I have a container with 100 buttons, arranged 10 X 10. I just used the button base class, stupidly, cos later I realised that each button would be calling the same form method. So I'd like to add a method to a button and make it a class. Trouble is, it took ages to arrange the buttons' positions, size, etc., and I don't want to have to do it all again with the new class.
>
>So I was wondering if there was a way to convert all the buttons to the class, without disturbing them all. As you know, the BaseClass prop of an object is written in stone.
>
>No biggie - I can always build a new container - just wondering if I could avoid it.
>
>'ppreciate it
>
>Terry

Make a copy of the form (all files SCX and SCT), open form as table:
USE MyForm.SCX
SET FILTER TO UPPER(ALLTRIM(Class)) == "COMMANDBUTTON"
REPLACE ALL ClassLoc WITH "..\lib\my_vcx.vcx" && Relative path to your visual class library
GO TOP
REPLACE ALL Class WITH "MyButtonClassName"    && The real name of the class you build
not tested at all just make sure you have old form somewhere else.
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform