(Still vfp7)

First time using a spinner control and not understanding when the
spinner sourcecontrol is updating...

In this example, the spinner controlsource is a form property containing
a numeric value.

The resulting value is used in a SEEK which, if successful, updates the
form.

Question: When is the spinner controlsource updated?

I'm finding that I have to run math on the value to execute the seek...
for example;

If it's a "DownClick" event, I have to subtract the increment from the
controlsource to execute the seek for the expected value following a
downclick.

What concerns me more is that when trying to track this using the
debugger, the value did, at some points, decrement during the processing
of the downclick event.

Thanks in advance,
Beverly Howard

Re: Spinner Events by Lew

Lew
Sun Sep 23 14:41:30 PDT 2007

... have you tried using the interactivechange event code? It may side step
these issues.

"Beverly Howard [Ms-MVP/MobileDev]" <BevNoSpamBevHoward.com> wrote in
message news:uOLUoxh$HHA.4732@TK2MSFTNGP04.phx.gbl...
> (Still vfp7)
>
> First time using a spinner control and not understanding when the spinner
> sourcecontrol is updating...
>
> In this example, the spinner controlsource is a form property containing a
> numeric value.
>
> The resulting value is used in a SEEK which, if successful, updates the
> form.
>
> Question: When is the spinner controlsource updated?
>
> I'm finding that I have to run math on the value to execute the seek...
> for example;
>
> If it's a "DownClick" event, I have to subtract the increment from the
> controlsource to execute the seek for the expected value following a
> downclick.
>
> What concerns me more is that when trying to track this using the
> debugger, the value did, at some points, decrement during the processing
> of the downclick event.
>
> Thanks in advance,
> Beverly Howard
>
>
>



Re: Spinner Events by Beverly

Beverly
Sun Sep 23 15:08:57 PDT 2007

>> tried using the interactivechange event code? <<

Will revisit that... tried it on another "valid" issue only to learn
that it was not working as I understood it.

Thanks,
Beverly Howard


Re: Spinner Events by Dan

Dan
Sun Sep 23 16:39:28 PDT 2007

As with any other bound control, the .Value will only be written to the
source when the control loses focus.

In .InteractiveChange() you could call This.Setfocus() which forces a focus
change, or you could REPLACE (THIS.Controlsource) WITH This.Value.

The control needs to lose focus before the .Value is reliably written to the
controlsource.

Dan

Beverly Howard [Ms-MVP/MobileDev] wrote:
> (Still vfp7)
>
> First time using a spinner control and not understanding when the
> spinner sourcecontrol is updating...
>
> In this example, the spinner controlsource is a form property
> containing a numeric value.
>
> The resulting value is used in a SEEK which, if successful, updates
> the form.
>
> Question: When is the spinner controlsource updated?
>
> I'm finding that I have to run math on the value to execute the
> seek... for example;
>
> If it's a "DownClick" event, I have to subtract the increment from the
> controlsource to execute the seek for the expected value following a
> downclick.
>
> What concerns me more is that when trying to track this using the
> debugger, the value did, at some points, decrement during the
> processing of the downclick event.
>
> Thanks in advance,
> Beverly Howard



Re: Spinner Events by Beverly

Beverly
Mon Sep 24 14:35:22 PDT 2007

>> The control needs to lose focus before the .Value is reliably
written to the controlsource. <<

That's what I needed to know... makes sense now.

Thanks,
Beverly Howard



Re: Spinner Events by Cy

Cy
Mon Sep 24 21:08:23 PDT 2007

Did you use this.value rather than looking directly at the controlsource?
The value of the control changes before the controlsource is modified so
that you validation code can stop the change from happening if you want to
stop it. The value property of the control will always contain the new
value before the controlsource as long as the change is coming from the
control. As a matter of fact I use the value and just set that so I don't
have to worry whether the controlsource is a variable, a property or a field
(some of which have to be handled differently) but with the value property
you just set the value and the control handles the differences
automagically.

--
Cy Welch
Senior Programmer/Analyst
MetSYS Inc.
http://www.metsysinc.com

"Beverly Howard [Ms-MVP/MobileDev]" <BevNoSpamBevHoward.com> wrote in
message news:#lIVX5i$HHA.2004@TK2MSFTNGP06.phx.gbl...
> >> tried using the interactivechange event code? <<
>
> Will revisit that... tried it on another "valid" issue only to learn that
> it was not working as I understood it.
>
> Thanks,
> Beverly Howard
>

Re: Spinner Events by Beverly

Beverly
Tue Sep 25 09:38:30 PDT 2007

>> this.value <<

thanks... that's excellent info and looks like what I am looking for.

Beverly Howard