Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Add Tables
Message
De
16/03/1998 05:42:45
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Titre:
Divers
Thread ID:
00084113
Message ID:
00084774
Vues:
38
Hi Eric,
How does setting controlsource fail ? Normally when you drop a form class, form is automatically contained in a formset, might it be you're referencing from a prg and you should also include "thisformset." or formsetname ?
Cetin

>Sawadee Kahp,
>
>I am also having problems setting a controlsource property on a .scx that was created using a form class. The last suggestions from Cetin seems to work only for .scx built in the form designer from scratch. I built a form from scratch in the form designer that looks exactly like the form derived from a classlib. DE properties all the same. Both are .scx files yet one returns an error when setting ControlSource properties and the one built in the form designer does not. ? They are both built in the form designer but one was dumped from a classlib in the toolbar. You would think the form built from a class would be more flexible since it is a situation where I need to use this form many times in the future. ;)
>
>Eric K.
>
>>Hi Eric,
>> You mention being unable to save the DE with a form class. Unfortuantely VFP does not allow a form class to be saved with a DE, only form instances(scx's). Not sure why your AddObject("DataEnvironment"... failed at runtime.
>>HTH
>>Ned
>>> As the battle rages on, I seem to be getting nowhere...
>>>
>>>I'm encountering a host of problems with forms. When run as a normal .scx from the project manager myform returns: "The data source for this object must be variable reference"
>>>
>>>use mytable in 0 alias dummy
>>>thisform.Text1.controlsource = dummy.description <-- This line causes the error
>>>
>>>If I comment out this line the form .scx runs normally.
>>>
>>>The following code causes another error when I attempt to use a class with a DE containing cursor1 and the initial selected alias set to cursor1.
>>>
>>>SET CLASSLIB TO vdolib.vcx ADDITIVE
>>>oPlayForm = CREATEOBJECT('test')
>>>oPlayForm.dataenvironment.addobject("cursor2","cursor") <-- Causes unknown member error ie: there is no DE contained in this instance
>>>
>>>BTW - This error is the same with nothing in the data environment prior to saving as class
>>>
>>>I guess I don't understand this error. If I create a form visually with a DE and control sources set(like the wizard), why does it complain it is an unknown member when this form is saved as a class, then created using CREATEOBJECT()? Is this not essentially the same object whether run as .scx or an object created in runtime code? Do I need to oPlayForm.addobject("dataenvironment", "dataenvironment")? I attempted this and got a message saying the object type is invalid for the container. Does this mean the form that was saved as a class does not qualify to contain a DE?
>>>
>>>The score is now, VFP - 1
>>> ERIC - 0
>>>
>>>Eric K.
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform