>>I am setting up some BuilderB builders & would like to scan the DataEnvironment of my form ( during development - modify mode ) to populate my ControlSource combo box. I would like it to perform just like the properties combobox.
>>
>>Any one created a component for this & if not can they point me in a direction?
>>
>>I tried looking at the dataenvironment property sheet but could find no collection for the cursors. I was going to use the AddItem() method in the component's init event and load it from an afield() array. But, I couldn't find a way to scan the available cursors. Obviously, this is possible as it is on the standard property sheet - I'm just myopic & don't see it.
>
>I've just uploaded an article on how to make a builder which will do something with dataenvironment. Just look at recent articles or click on my name. The code there doesn't do a thing with controls, though, but it gets you an object reference for each cursor in the DE, and you can take over from there.
Dragan,
I spoke too soon. I can use your code to get what I want but I need to pass my builder a referance to the form/form.dataenvironment that the component is on. ie if I put a check box on formA I need to run Levey's BuilderB by calling it as follows in the BuilderX property:
libraryName,myCheckBoxBuilder WITH ThisForm.DataSession
or
libraryName,myCheckBoxBuilder( ThisForm.DataSession )
Then in the myCheckBoxBuilder form's Init method I can run the default code and populate a custom form.cursorarray collection with the cursor names from the passed datasession object. From there I can load my cboControlSource with the cursor names.fields list I need to pick the ControlSource property from.
See what I am trying to do?
I think I need to modify the Builder code in VFP to allow parameter passing but I can't find it to modify.
Thanks in advance
Terry
It is impossible to make programs idiot proof. Idiots are too cleaver.
MCP( Tcp/Ip )