Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How do I create a VCX without using the Class Builder?
Message
De
12/04/2000 00:16:58
David Fluker
NGIT - Centers For Disease Control
Decatur, Georgie, États-Unis
 
 
À
11/04/2000 22:41:09
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00358362
Message ID:
00358525
Vues:
19
>>CREATE CLASSLIB Junk
>>CREATE CLASS MyTextBox OF Junk.VCX AS _Textbox From _Base.VCX
>>MODIFY CLASS MyTextBox OF Junk.VCX NOWAIT
>>ASELOBJ(xx)
>>xx[1].Width= 100
>>xx[1].Writemethod("Click","WAIT WINDOW PROGRAM() NOWAIT" + CHR(13)+ "RETURN .T.")
>
>>xx[1].Save()
>
>Probably an example is just proof of concept, but the last line results in an error. There is no method "Save" for "mytextbox". My attempt to use SaveAsClass instead resulted in conflict with active "Modify Class". It would be nice to achieve closing "Modify Class" form automatically.

Michael,
You *can* close the modify class window programmatically. It is a VFP system window which you can manipulate with RELEASE WINDOW, SHOW WINDOW, HIDE WINDOW, MOVE WINDOW, etc. The name of the window will be "CLASS DESIGNER - classlibname (classname)"

So adding the following code will close the designer and save the class. The Keyboard 'Y' tells the "Save changes?" dialog box to save the changes. I use all caps for window names because FoxPro window functions like WONTOP() return all caps.
cWin = "CLASS DESIGNER - JUNK.VCX (MYTEXTBOX)"
KEYBOARD 'Y'
RELEASE WINDOW (cWin)
And if you HIDE WINDOW (cWin) before you start your changes it will be almost invisible to the user.

David.
David.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform