Bài giảng Lập trình C# 2010: Chương trình bày các nội dung tiếp theo của chương 2 về DateTimePicker & MonthCalendar, các thao tác cơ bản, nút lệnh và tính năng của nó, cách thức thực hiện cùng một số nội dung khác. | 1 DateTimePicker & MonthCalendar 2 Name Description Format Gets or sets the format of the date and time displayed in the control CustomFormat Gets or sets the custom date/time format string Value Gets or sets the date/time value assigned to the control. = ; = "MMMM dd, yyyy - dddd"; Next Slide to see list Custom Format 3 Format string Description d The one- or two-digit day. dd The two-digit day. Single-digit day values are preceded by a 0. ddd The three-character day-of-week abbreviation. dddd The full day-of-week name. h The one- or two-digit hour in 12-hour format. hh The two-digit hour in 12-hour format. Single digit values are preceded by a 0. H The one- or two-digit hour in 24-hour format. 4 Format string Description HH The two-digit hour in 24-hour format. Single digit values are preceded by a 0. m The one- or two-digit minute. mm The two-digit minute. Single digit values are preceded by a 0. M The one- or two-digit month number. mm The two-digit minute. Single digit values are preceded by a 0. M The one- or two-digit month number. MM The two-digit month number. Single digit values are preceded by a 0. MMM The three-character month abbreviation. 5 Format string Description MMMM The full month name. s The one- or two-digit seconds. ss The two-digit seconds. Single digit values are preceded by a 0. t The one-letter . abbreviation (. is displayed as "A"). tt The two-letter . abbreviation (. is displayed as "AM"). y The one-digit year (2001 is displayed as "1"). yy The last two digits of the year (2001 is displayed as "01"). yyyy The full year (2001 is displayed as "2001"). 6 private void frmListBox_Load(object sender, EventArgs e) { (); for (int i = 0; i < 10; i++) ("Item " + i); } private void listBox1_SelectedIndexChanged (object sender, EventArgs e) { = +" was clicked!"; } ListBox 7 And We . | 1 DateTimePicker & MonthCalendar 2 Name Description Format Gets or sets the format of the date and time displayed in the control CustomFormat Gets or sets the custom date/time format string Value Gets or sets the date/time value assigned to the control. = ; = "MMMM dd, yyyy - dddd"; Next Slide to see list Custom Format 3 Format string Description d The one- or two-digit day. dd The two-digit day. Single-digit day values are preceded by a 0. ddd The three-character day-of-week abbreviation. dddd The full day-of-week name. h The one- or two-digit hour in 12-hour format. hh The two-digit hour in 12-hour format. Single digit values are preceded by a 0. H The one- or two-digit hour in 24-hour format. 4 Format string Description HH The two-digit hour in 24-hour format. Single digit values are preceded by a 0. m The one- or two-digit minute. mm The two-digit minute. Single digit values are preceded by a 0. M The .