Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How do I create a VCX without using the Class Builder?
Message
From
12/04/2000 00:16:58
David Fluker
NGIT - Centers For Disease Control
Decatur, Georgia, United States
 
 
To
11/04/2000 22:41:09
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00358362
Message ID:
00358525
Views:
14
>>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.
Previous
Reply
Map
View

Click here to load this message in the networking platform