Thanks Laurie. After moving the code to the InteractiveChange event, it worked great! If you key in anything greater than 60, it instantly changes to 60. Any value other than an increment value allows the keystroke input, but then it updates instantly to the closest correct value below what was keyed in.

When clicking the spinner button "up" it goes up in the correct increments until it hits the max of 60, then it stops.

Mike

Laurie Alvey wrote:
I think you need another check in your code so that you jump down if a jump
up would take you over the maximum or a jump down would violate the minimum
value.

Laurie

On 22 September 2014 21:02, Mike Copeland <[email protected]> wrote:

Thanks Fred! You win! :)


Fred Taylor wrote:

Get the result of your MOD(value,2.50) and subtract it from your value.

Fred

On Mon, Sep 22, 2014 at 12:41 PM, Mike Copeland <[email protected]> wrote:

  I think I'm having an old-timer's spell...
I have a spinner that I need to force into the following values...
0 minimum
      2.50
      5.00
      7.50
          etc.
60.00 maximum

So, I set
      .KeyboardLowValue and .SpinnnerLowValue = 0
      .increment = 2.50
      .KeyboardHighValue and .SpinnerHighValue = 60.00
      .InputMask = '99.99'
and it works great...IF you use the spinner buttons.

But if you key in a value like "6.00" then the spinner, dutifully and
accurately, goes through
      3.50
      6.00
      8.50
          etc.

Now, if you use the spinner buttons to increment all the way down to 0
then it, effectively, does a reset and the incremental values work fine.
      0.
      2.50
      5.00
      7.50
          etc.

So, I'm going to add a "VALID" check, like
      if mod(this.value,2.50)<>0
              * do something here
      endif

Which brings me to my Question...
What can I insert in the "* do something here" to bump the value up (or
down) to the next acceptable increment?
So, if the user keys in 6.00, I want it to auto-update to either 5.00 or
7.50...not picky which.

What am I missing?
(I've already Googled this for me and read several posts without
success...therefore I awaken the gods of VFP!)
Thanks!

Mike Copeland


[excessive quoting removed by server]

_______________________________________________
Post Messages to: [email protected]
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/[email protected]
** 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