Thanks Ted, that was a huge help!

-----Original Message-----
From: ProFox [mailto:profox-boun...@leafe.com] On Behalf Of Ted Roche
Sent: Tuesday, January 19, 2016 3:57 PM
To: profox@leafe.com
Subject: Re: Spinner Control Anomaly

Generalizing this, a Control's .Value changes as you diddle with the
display, but the control doesn't commit the .Value to the bound data
until the Valid() returns .T., iow, you have a chance to validate the
data. This is the normal flow of events when tabbing through controls,
but doesn't catch all cases. This causes confusion when control moves
outside of the form, as in your menu invocation, or when a Timer
fires, or another screen pops up.

IIRC, without testing, frameworks I've work with do this generically with:

_VFP.ActiveForm.ActiveControl.SetFocus()

(yeah, unintuitively, setting focus to the control with focus causes
it to cycle through a series of events like LostFocus(), Valid(),
When() and GotFocus())


On Tue, Jan 19, 2016 at 3:48 PM, Richard Caruso
<rcar...@acutedesigns.com> wrote:
> I've been struggling with a bug and it came down to a spinner control.
I've
> gleaned a lot from this community and thought I'd pass my solution along
for
> comments/suggestions.
>
> I am using a spinner control with the control source gnYear. Clicking on
the
> up/down spinner arrows changes the value of what the spinner displays, but
> does not change the value of the control source.  I verify this by
> displaying the control source gnYear in a wait window from the spinner's
> interactive change method.  While the spinner control is still active,
> selecting a menu option to call a function that uses gnYear does not
produce
> the desired results since gnYear remains at its initial value.
>
> For example, gnYear is 2016 when the form loads.  I change the spinner
value
> to 2014. I immediately select a menu option to call a function that uses
> gnYear, but gnYear is still 2016, not 2014 as I would expect it to be.
The
> value of gnYear is set to the correct value only when focus is set to
> another object.  So my resolution is to setFocus to another object in the
> spinner's mouseLeave method.
>
>
>
>
>
> --- 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: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/002101d1538f$c25e6550$471b2ff0$@acutedesigns.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