Ken (or anyone) - 

Why did you ask that question about the combobox and using arrays to
populate them?  I suggested loading the array in the Load method, which
works fine.  The reason I ask/mention this is that I've suddenly been
getting odd behavior from my listboxes and comboboxes that are populated
with arrays.  I have, at times, also loaded the array in the Init method and
it worked fine.  But the other day I had a customer report that a listbox
that previously had multiple entries (field names from a table to use when
sending data to Excel), now only had one entry.  I had not changed that code
in quite awhile.  Similar behavior was witnessed on another form in that
same app and today I've noticed it in another app (two entries in a combobox
that previously had 12).  All of these arrays were defined in the Init.
Moving them to the Load will fix the problem, I know, but I'm trying to
figure out how this got broken and why is it partially broken (why do one or
two entries get recognized instead of none).  It would seem I made some
change to my framework and unknowingly broke this, but I can't imagine what
and I'm only making occasional changes to the framework and base classes
these days.  Certainly none in recent memory to the combobox and listbox.
It's curious that you had trouble when you loaded the arrays in the Init,
yet some of my code that worked fine in the past is now broken.
Coincidence?  My fault?  I don't know, but it's rather odd.

Russell

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Russell Campbell
Sent: Sunday, September 24, 2006 11:46 PM
To: [EMAIL PROTECTED]
Subject: RE: oop data entry form

You can load the array in the Load method and it works fine.  Perhaps I
misunderstand the problem here.  I load my form property arrays in the Load,
set the RowSource property to the array at designtime, set the RowSourceType
to "Array" also at designtime, and everything works like a champ.

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Ken Dibble
Sent: Sunday, September 24, 2006 10:36 PM
To: [EMAIL PROTECTED]
Subject: Re: oop data entry form


>
>also in the form.load I create some arrays and a cursor to hold values for
>listboxen &c. on the form, but where do I set the rowsource properties - if
>I set them directly in their control properties or programmatically in the
>control's init the arrays aren't yet in scope
>same for the controlsources which I want to bind to properties of the data
>object (when I get one)


I had a heck of a time figuring out the array RowSource issue. I figured, 
since the listbox or combobox Inits before the form Inits, that the 
controls wouldn't be able to see a RowSource array on the form. But that's 
not true.

So, if you add your rowsource arrays as properties to the form at design 
time, using the New Property option from the Form menu, the listboxes and 
comboboxes will see them. Make sure to specify the arrays as:

aMyArray[1]

If you call code to fill those arrays from the form's Init() method, the 
controls will be populated when the form appears.

Another option is to create a listbox baseclass that contains its own 
internal array rowsource. If you do that, though, you can't have it fill on 
Init() if you're depending on the form to call data into being, since the 
listbox will init before the form. My listbox class has a FillOnInit switch 
that I can turn on or off at design time depending on the circumstance. 
When .T., the listbox calls its own Fill() hook method when it inits. If 
I'm depending on availability of meta- or other data from the business 
object, I turn this switch off and have the form call the Fill() method 
when it (the form) is satisfied that it's got all its data.

Ken Dibble
www.stic-cil.org




[excessive quoting removed by server]

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to