Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Control to enter duration
Message
 
 
À
29/05/2007 12:35:22
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01228473
Message ID:
01229140
Vues:
9
>>>>>Well, the value (or ControlSource) is an Integer. The format and mask just display it with the colon in between
>>>>>So, if you want an hour you would enter 100. For one second enter 1
>>>>>
>>>>>How would the textbox know that 1 is either one second or one hour ?
>>>>
>>>>I'm not sure, but in my opinion it's inconvenient. I'd rather try with the classes Marcia suggested if I can get ahold of the article...
>>>
>>>Ok, sorry for the inconvenience
>--------------
>>Gregory,
>>
>>No problem, sorry for being so picky :) Anyway, I'm going to get classes from the book soon, so I may adapt them instead.
>>
>>The idea of this texbox basically works and it may work for my users too...
>>
>>Anyway, I'll play with other classes too and compare.
>>
>>Thanks again for your great input.
>--------------------
>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 ]

Hi Gregory,

I'm just reading 1001 things book and they use the same concept for the simple time textbox:

Table 4.3 Rules for entering a time value

User Enters
Interpret as
Result

1
A specific hour, no minutes
01:00

11
Hours only, no minutes
11:00

111
Hours and minutes, leading zero omitted
01:11

1111
Exact time
11:11
=================================================================================
So, perhaps I'm going to adapt this class for my needs. And there is another spinner class, which may be even better.

BTW, in the same chapter I see a txtNumeric with this strange description:

super duper nemeric textbox: cannot be used on forms with combo boxes

Why it can not be used on forms with combos?

=================================================================================
I also just placed the time spinner control from the book on my form to see how it works and it doesn't behave correctly - e.g. has some bugs in it. Say, I was able to put 23:67 after the first messagebox showed up.

I guess, I'd rather try with the txtTime then because I don't want to spend too much time figuring what's wrong.
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform