-
4
- #1
Mike Lewis
Programmer
I just came across this while perusing some old notes, so I thought I would share it. It could be you all already know this, but in case you don't ....
You have a form containing a textbox. The textbox is of type Date (that is, it is either bound to a Date field or you set its initial Value to a date). The user can edit the date in the usual way by positioning the insertion point and typing in the appropriate numbers. So far, so good.
But did you know that the user can also highlight the entire date, then press + (plus). This will increment the date by one day. After you have done this, the date remains highlighted, so you can press + repeatedly to keep incrementing the date.
In exactly the same way, pressing - (minus) will decrement the date by one day. (It also works with DateTimes.)
This happens by default, in the native textbox. If you set the Format property to K in your base textbox class, the date will be highlighted as soon as the user tabs to it, which makes life a little bit easier.
Of course, many of us use some sort of drop-down calendar with our date fields, but if you just use a plain textbox, this little tip might be worth keeping in mind.
Mike
__________________________________
Mike Lewis (Edinburgh, Scotland)
Visual FoxPro articles, tips and downloads
You have a form containing a textbox. The textbox is of type Date (that is, it is either bound to a Date field or you set its initial Value to a date). The user can edit the date in the usual way by positioning the insertion point and typing in the appropriate numbers. So far, so good.
But did you know that the user can also highlight the entire date, then press + (plus). This will increment the date by one day. After you have done this, the date remains highlighted, so you can press + repeatedly to keep incrementing the date.
In exactly the same way, pressing - (minus) will decrement the date by one day. (It also works with DateTimes.)
This happens by default, in the native textbox. If you set the Format property to K in your base textbox class, the date will be highlighted as soon as the user tabs to it, which makes life a little bit easier.
Of course, many of us use some sort of drop-down calendar with our date fields, but if you just use a plain textbox, this little tip might be worth keeping in mind.
Mike
__________________________________
Mike Lewis (Edinburgh, Scotland)
Visual FoxPro articles, tips and downloads