Developer Network> Development Tools> Development Columns> VC> Text
The control is a very important location in Visual C programming learning. The author saw this article on calendar control learning on the English website, although the content seems simple, but after reading it, I feel some things. I feel that the original author writes a very detailed manner that the use of some unopened calendar control methods is very detailed, it is easy to understand, and it is magical in the flat, which is the "deep excavation" of the calendar control. The initiator of VC should be very Help, so translators will introduce them to domestic readers. I. Introduction to the calendar control WIN32 API provides a display date when a color calendar control, the date display mode is based on regional settings in the control panel or is dependent on the user's operating system. The specific calendar control is shown below:
Figure 1, calendar control display effect
The headline of this common calendar control contains two buttons and two labels, the button on the left, the user clicks selected the previous month, the label on the left displays the currently selected month, the label on the right shows the year in the current date. The button on the right is to let the user choose the next month. The calendar control can be configured to display multiple months, the following figure is a specific instance:
Figure 2, displaying a calendar control in multiple months
If you want the calendar control to display multiple months, the number of buttons will increase or decrease through the previous months or the next list. For example, if the control is displaying April or May, then the user clicks on the left button, the control will display March or April; if the user clicks on the button on the right, the control will display May and June. In addition, select any month in the current year, the user can click on the month name in the title box, this time will display a month list for the user to select. Specifically, as shown:
Figure 3, display month list
If you want to change the year, the user can click on the year tag, at this time, the rotation button will be displayed, and the user can change the year by clicking the upper and lower keys of the rotation button, or use the up and down arrow on the keyboard to change the year.
Figure 4, changing the year of the calendar control
In the following, the weeks are short-written under the format of the control panel, in English, the first day of each week is usually on Sunday. Developers can change the first day setting in the control. On the control, there is a circle in the currently selected date. Users can click on the date to choose to select a date on the control. In most areas, the date appears in a white background (this background color or even the colors on the control can be changed by the program). By default, the control displays the current date around an ellipse. Use the title bar buttons, months and year labels, users can change the date. If the control is not currently the current date, the user can display the label today to display the label today to make the control today. (If you are a programmer, you can hide this label on the bottom of the control).
Full text: Detailed explanation of calendar control in Visual C