How to Simulate Date Spinners by Using a Set of ButtonsLast reviewed: September 26, 1995Article ID: Q137181 |
The information in this article applies to:
SUMMARYFoxPro for Windows includes the data entry object called a Spinner control to help users enter numeric data. This article shows you how to create a simulated Date Spinner control to help users choose a date. The technique involves using a set of buttons with a date field to create the simulated Date Spinner control. A third button is included to allow the user to clear the date or set it to the current system date.
MORE INFORMATIONThe main function of the Date Spinner buttons is to increase or decrease the value of the date by one or more days. FoxPro supports date arithmetic. Adding a whole number to a date changes the date to the date that is that number of days in the future. Subtracting a whole number from a date changes the date to the date that is that number days in the past. The example in this article uses three buttons. The Plus and Minus buttons add or subtract one from the date field. If the date field is empty, the buttons set it to the current system date. The optional third button has two functions. When the date field has a value, the third button displays the letter C to indicate that it will clear the date value. When the date field is empty, the third button displays the letter T to indicate that it will set the day to today's date. This is not a feature you would normally find with a Spinner object, but it can be a handy one for data entry.
Steps to Create Date Spinners by Using Buttons
|
Additional reference words: 2.50 2.50a 2.50b 2.60 2.60a date spinner FoxWin
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |