>I don't have a ControlSource set on the listBox my version of this that I created with the 'MODIFY FORM', and it works. Besides, what would I set the controlSource to? I tried setting it to the array (which is the recordSource), that didn't work.
>
When I tried your posted code (modified for my drive mappings), I got the same results you got.
I added a filler property to the form : cListBoxSource=""
Then I set the ControlSource of the listbox to "thisform.cListBoxSource"
Worked like a charm.
Don't know why it would work in the form. I haven't had much luck getting visual classes with contained controls to work by DEFINEing them in programs.
Too much work for me. <g>
Anyway, this is how I modified it...
define class mainForm as Form
add object fileList as listBox with ;
top = 50, ;
left = 10, ;
width = this.width - 20, ;
rowSourceType = 5, ;
boundColumn = 1
dimension dirArray(1)
<b>cListBoxSource=""</b>
procedure init
if (aDir(thisForm.dirArray, 'g:\ssi605\data\hksreg\*.*') > 0)
thisForm.fileList.rowSource = 'thisForm.dirArray'
<b>thisform.filelist.controlsource = "thisform.clistboxsource"</b>
endif
endpro
enddef
Insanity: Doing the same thing over and over and expecting different results.