Subject Re: AutoDropNot
From Tom <IHaveNoEmail@ddress>
Date Tue, 6 Nov 2018 07:29:44 -0500
Newsgroups dbase.getting-started

On 11/5/18 9:38 AM, Mervyn Bick wrote:
> On 2018-11-04 7:58 PM, Tom wrote:
>> Hi all,
>>   Been fooling around with this for most of the morning. As you can
>> see, numerous code changes still fail to produce a combobox autodrop.
>> Can you straighten me out.
> This has been overtaken by events. :-)
Life happens ...

> I was working on this this morning but I had to go out for a while.  In
> the meantime you have solved the problem yourself.  Your solution works
> because it uses a Windows function to pass an instruction direct to the
> combobox.  My solution was to use the combobox's keyboard() method to
> pass it F4.  This probably causes dBASE to use the exact same windows
> function internally.
Included in my lengthy list of trial and error solutions was the
keyboard method but I did not come up with the correct syntax.

> Back to the problem.
> > A couple of comments.
> The object of the exercise appears to be to only show the combobox
> "drop" button if the control has focus.
The object of the exercise is to provide the user with a list of
possible values to be placed in the underlying entryfield. Never allow
users control of anything, merely provide them with that illusion.

> You are going to need a separate combobox for each entryfield.  I've

This statement I do not understand. I was attempting to use the same
combobox with appropriate list information for each/any entryfield that
it overlies. The combobox need not be datalinked, just transfer
entryfield value to combobox during onGotFocus and transfer user
selection back to entryfield during onLostFocus. One combobox could be
used with many entryfields. Better than my current method of popping up
a window containing a listbox directly under/over selected entryfield in
my opinion.

> commented out the line in the EFDATE constructor code that assigns the
> onGotFocus event handler so that the existing CHOLLA control only
> displays over the EFCHARACTER control.
> The datasource for each combobox needs to be set up before the form
> opens so that the default selection can be displayed in EFCHARACTER when
> the form opens.  If you don't want to open with a default setting
> display something like "Make selection" when the form opens.  If you do
> this the control must not be datalinked to a field.
> When CHOLLA loses focus you need to save the value from CHOLLA back to
> EFCHARACTER and write the value to a field if necessary.
> A revised version of your form with some comments where I've made
> changes is attached.
> Mervyn.
Thank you for your work on the example. Illustrations help everyone
understand what and how to achieve desired results.