Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Control to enter duration
Message
From
29/05/2007 12:52:04
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01228473
Message ID:
01229102
Views:
15
>>Nadya,
>>
>>You're welcome
>>
>>What I wanted to say is that this is a rather quick way to enter one hour = 4 keystrokes: 1 0 0 ENTER
>>
>>Should you have two textboxes, you would enter 3 keystrokes : 1 ENTER ENTER
>>
>>In case of working with spinners (1) manual: 3 keystrokes, (2) with the mouse takes more time
>>
>>1:15
>> with one textbox = 4 keystrokes: 1 1 5 ENTER
>> with 2 textboxes = 5 keystrokes: 1 ENTER 1 5 ENTER
>>
>>
>>Using two controls makes it more difficult to store hhmm in one table field
>>
>>So, I find one textbox better. On occasions you'll have a keystroke too many
>>
>>In the supermarket (cash register) they never enter the decimal point.
>>One dollar is 1 0 0 (or 1 00)
>>$1.50 is 1 5 0
>>
>>In this case you never enter the colon, but you have to explain to the textbox where the colon should be - like the cash register - you never enter the colon [ or with two textboxes an ENTER or TAB ] and on occasions you have to enter a zero too many. But hey, you never enter the colon [ or decimal point ]
>------------------------------------------------------------------------
>Good points. In case of multiple textboxes I guess we need a container based class which would allow to save value in a field using container's LostFocus (I guess). I also need a way to display correct value. And finally, in my table I store duration in minutes, so I would need to convert hh:mm to mm.

If your store hhmm and you know it, then the minutes become int(hhmm/100) * 60 + mod(hhmm,100)
[ or use a view ]

You can convert it to minutes - by the control or by the record rule. You could then have another control to display the minutes in hh:mm by simply change the controlsource
[ or use a view ]

>
>Anyway, for now I put the problem aside and working on something else right now. It's also a good idea to go out and take some lunch...

Keep me posted after you have found the other classes
Gregory
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform