Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Adding table to a form from a class
Message
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00045276
Message ID:
00045348
Views:
36
>>I am instantiating a form from a class that has a grid with .ColumnCount = -1. I'm trying to figure out how to assign it a table. I have learned that I cannot use oForm.AddObject('Dataenvironment','Dataenvironment') because it is not a member. Should I not use a data environment at all? Should I just say oForm.MyGrid.Recordsource = 'Mytable'? That's what I'm doing at the moment. For whatever reason, the instantiated form flashes for an instant and control returns to the calling form. I did not put a CLEAR EVENTS in my class. What are the requirements for getting a table into the form and making it stay there?
>Bret,
>
>First ot get the new fomr to keep focus you need to make it modal. To open your table you can do that in the form's Load event.

I made it modeless so my file menu would work. I thought it was good practice in general to make most forms modeless. The form is not just losing focus, it's unloading. I'm using a general form class. I don't see how I can put stuff specific to one use in the form.Load. When I use CREATEOBJECT(), the .Load and .Init will execute before I can do anything else.

I have made an .SCX based on my class, run with a DO FORM. I could make a subclass for this specific use, with my table build in, but it seems like I shouldn't have to do that.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform