Re: Control on Form for numeric values

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Thanks Fred,

As per your guidance I wrote :

if MOD(this.Value,this.Increment) < (this.Increment/2)
this.Value = this.Value - MOD(this.Value,this.Increment)
else
this.Value = (this.Value - MOD(this.Value,this.Increment))+this.Increment
endif

It is working like a charm.

Thanks for taking time to provide guidance.

With Regards

S Bans

"Fred Taylor" wrote:

You'd be better off with something liike this in the .Valid of the Spinner:

this.Value = this.Value - MOD(this.Value,this.Increment)


--
Fred
Microsoft Visual FoxPro MVP


"S Bans" <SBans@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:FBDEA88E-63DA-40B5-A091-76AD3521B590@xxxxxxxxxxxxxxxx
Thanks Fred,

Your suggestion gave the desired results.

Can you please suggest, what will be the efficient way to ensure that the
values in the Spinner Object remains in multiples of 0.05 even if
ProgramaticChange or InteractiveChange event results in the value not
being
in multiples of 0.05

With regards

S Bans

"Fred Taylor" wrote:

Use a Spinner object and be sure to set the initial .Value property to
include the 2 decimal places and the .Increment property to 0.05 is all
you
should have to do.

--
Fred
Microsoft Visual FoxPro MVP


"S Bans" <SBans@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:82AFAC53-5A08-450F-AA10-5756E721916C@xxxxxxxxxxxxxxxx
Hello,

I have a form. I am looking forward to have a control on this form,
which
can accept Positive, numeric values with two decimal places (May be
TextBox
should do). However I have not been successful in implementing it. I am
looking forward to guidance of seniors for implementing it.

It will be nicer if you can guide me about implementing it in such a
manner,
that it rounds the values in multiples of 0.05 and Up & down arrows
increment
or decrement the values in multiples of 0.05.

Please accept my thanks for your help.

With Regards

S Bans






.



Relevant Pages

  • Re: Passing by VALUE / CStr equivalent
    ... I will look forward to any further guidance in this regard. ... With Regards ... S Bans ... In our of my Visual foxPro codes I am using OLE Automation to ...
    (microsoft.public.fox.programmer.exchange)
  • Re: Passing by VALUE / CStr equivalent
    ... With Regards ... S Bans ... In our of my Visual foxPro codes I am using OLE Automation to Run ... I am looking forward to guidance of seniors to implement this thing in VFP ...
    (microsoft.public.fox.programmer.exchange)
  • Re: Control on Form for numeric values
    ... values in the Spinner Object remains in multiples of 0.05 even if ... With regards ... S Bans ...
    (microsoft.public.fox.programmer.exchange)
  • get new list id
    ... Need your guidance on this once, and thanks for the help before. ... Best regards, ... William ... Prev by Date: ...
    (microsoft.public.sharepoint.portalserver.development)
  • Re: Downloading Zip file from internet.
    ... Pro as OS and Mcafee virusscan and Firewall. ... > S Bans wrote: ... >> Regards, ...
    (microsoft.public.fox.programmer.exchange)