Yes.

There are a couple of points to add to that.
- The Event should call a method. My experience has shown switching forms that 
are configured as private data sessions may not be in the right memory space in 
some event code. However, that problem appears to go away when the event calls 
a method. 
    An explanation of not being in the right memory space is the event code 
references a table in the forms data session or object on the form, VFP throws 
an error that it wasn't found. When the event calls a method on the control or 
the form it is contained in, that has not happened that I have seen. Though, I 
won't guarantee it will not happen. When the event tries to call a method on a 
hierarchy like `This.Parent.AnotherObject`, I have seen it error.
- How you want the user to experience the system may change which event you 
want to use. 
    The Got Focus and Lost Focus events are a good place for code that changes 
the background of the current item to help the user know what control has 
focus. 
    The Valid event can be used to validate the data in the control and 
returning .F. from the event prevents the control from losing focus. (textbox 
validations)
- There a many events, most of them I don't use.    


-----Original Message-----
From: ProfoxTech [mailto:profoxtech-boun...@leafe.com] On Behalf Of Joe Yoder
Sent: Wednesday, April 24, 2024 12:19 PM
To: profoxt...@leafe.com
Subject: Re: List box issues

So can we conclude that immediate refresh of another control is probably
not supported in any other event because Interactive Change is a better
design choice?

On Wed, Apr 24, 2024 at 11:52 AM Tracy Pearson <tr...@powerchurch.com>
wrote:

> The Interactive Change event happens when the user makes a selection
> change via arrow keys or mouse click.
> The Lost Focus event happens when the user moves to another control.
>
> Using the Interactive Change event to update other controls is better user
> experience.
>
> -----Original Message-----
> From: ProfoxTech [mailto:profoxtech-boun...@leafe.com] On Behalf Of Joe
> Yoder
> Sent: Wednesday, April 24, 2024 11:34 AM
> To: profoxt...@leafe.com
> Subject: Re: List box issues
>
> Thanks Tracy - Interactive change works!
>
> Is it by design that the refresh is only executed immediately from the
> Interactive vChange?
>
> Thanks,
>
> Joe
>
> On Wed, Apr 24, 2024 at 10:00 AM Tracy Pearson <tr...@powerchurch.com>
> wrote:
>
> > Should the code in the Lost Focus event actually be in the Interactive
> > Change event?
> >
> > -----Original Message-----
> > From: ProfoxTech [mailto:profoxtech-boun...@leafe.com] On Behalf Of Joe
> > Yoder
> > Sent: Tuesday, April 23, 2024 9:53 PM
> > To: profoxt...@leafe.com
> > Subject: Fwd: List box issues
> >
> > Thanks to Fletcher for the cursor clue I am closer to what I want.
> >
> > I have 2 files:
> >   Spaces with fields space_id and  descript
> >   Units with fields : unit_id, space_id, and descript
> >
> > I have a form with a list box for each
> >  the Spaces list box has the row source set  to 6 (Fields) of Spaces
> >  the Units list box has the Row Source type set to 3  (SQL Statement)
> >  and the Row Source to:
> >   select Spaces.Descript from Spaces  where Units.space_id =
> > Spaces.space_id int cursor xxx
> >
> > The Spaces listbox lost focus event has the following code:
> >   thisform.list2.requery
> >   this form.list2.refresh
> >
> > For some reason the Units list box does not display updated data before I
> > click on another box.  Actually clicking any other buttom causes the box
> to
> > update.
> >
> > What am I missing now?
> >
> > Thanks in advance.
> >
> > Joe
> >
> >
> > --- StripMime Report -- processed MIME parts ---
> > multipart/alternative
> >   text/plain (text body -- kept)
> >   text/html
> > ---
> >
[excessive quoting removed by server]

_______________________________________________
Post Messages to: ProFox@leafe.com
Subscription Maintenance: https://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: https://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: https://leafe.com/archives
This message: 
https://leafe.com/archives/byMID/00f001da9675$3170d870$94528950$@powerchurch.com
** 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