Danh mục

Bài giảng Lập trình C# 2010: Chương 2.2 - ĐH Công nghệ Đồng Nai

Số trang: 57      Loại file: pptx      Dung lượng: 4.63 MB      Lượt xem: 9      Lượt tải: 0    
Jamona

Hỗ trợ phí lưu trữ khi tải xuống: 27,000 VND Tải xuống file đầy đủ (57 trang) 0

Báo xấu

Xem trước 6 trang đầu tiên của tài liệu này:

Thông tin tài liệu:

Bài giảng Lập trình C# 2010: Chương 2.2 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.
Nội dung trích xuất từ tài liệu:
Bài giảng Lập trình C# 2010: Chương 2.2 - ĐH Công nghệ Đồng NaiDONG NAI UNIVERSITY OF TECHNOLOGY DONG NAI UNIVERSITY OF TECHNOLOGYDateTimePicker &MonthCalendar DONG NAI UNIVERSITY OF TECHNOLOGY Name Description Format Gets or sets the format of the date and time displayed in the control CustomForm Gets or sets the custom at date/time format string Value Gets or sets the date/time value assigned to the control.dateTimePicker1.Format = DateTimePickerFormat.Custom;dateTimePicker1.CustomFormat = MMMM dd, yyyy - dddd;Next Slide to see list Custom Format DONG NAI UNIVERSITY OF TECHNOLOGYFormat Descriptionstring d The one- or two-digit day. The two-digit day. Single-digit day dd values are preceded by a 0. The three-character day-of-week ddd abbreviation. dddd The full day-of-week name. The one- or two-digit hour in 12-hour h format. The two-digit hour in 12-hour format. hh Single digit values are preceded by a 0. The one- or two-digit hour in 24-hour H format. DONG NAI UNIVERSITY OF TECHNOLOGYFormat Descriptionstring The two-digit hour in 24-hour format. HH Single digit values are preceded by a 0. m The one- or two-digit minute. The two-digit minute. Single digit values mm are preceded by a 0. M The one- or two-digit month number. The two-digit minute. Single digit values mm are preceded by a 0. M The one- or two-digit month number. The two-digit month number. Single digit MM values are preceded by a 0. MMM The three-character month abbreviation. DONG NAI UNIVERSITY OF TECHNOLOGYFormat Descriptionstring MMMM The full month name. s The one- or two-digit seconds. The two-digit seconds. Single digit values ss are preceded by a 0. The one-letter A.M./P.M. abbreviation t (A.M. is displayed as A). The two-letter A.M./P.M. abbreviation tt (A.M. is displayed as AM). The one-digit year (2001 is displayed as y 1). The last two digits of the year (2001 is yy displayed as 01). The full year (2001 is displayed as yyyy DONG NAI UNIVERSITY OF TECHNOLOGYListBox private void frmListBox_Load(object sender, EventArgs e) { listBox1.Items.Clear(); for (int i = 0; i < 10; i++) listBox1.Items.Add(Item + i); } private void listBox1_SelectedIndexChanged (object sender, EventArgs e) { lblMessage.Text = listBox1.Text + was clicked!; } DONG NAI UNIVERSITY OF TECHNOLOGYAnd We can use AddRange method toadd data:private voidfrmListBox_Load(object sender,EventArgs e){string[] strArr = new string[]{ Tèo,Tí,Bin,Bo};listBox1.Items.AddRange(strArr);}public class CStudent DONG NAI UNIVERSITY OF TECHNOLOGY { private string m_strID; private string m_strName; public CStudent(string strID, string strName) { this.m_strID = strID; this.m_strName = strName; } public string ID { get { return this.m_strID; } set { this.m_strID = value; } } public string Name { get { return this.m_strName; } set { this.m_strName = value; } } } using System.Collections; DONG NAI UNIVERSITY OF TECHNOLOGYAlso We can use DataSource todisplay dataArrayList arr = newArrayList();for(int i=0;i DONG NAI UNIVERSITY OF TECHNOLOGYTo get object from Listbox, Wecould use coding below:if (listBox1.SelectedItem !=null) { CStudent svTeo = (CStudent ) listBox1.SelectedItem; lblMessage.Text =aStudent.Name + Was selected; } DONG NAI UNIVERSITY OF TECHNOLOGY CheckedListBox btnAdd btnAddAllchklbLeft chklbRig ht btnRemove btnRemoveA ll DONG NAI UNIVERSITY OF TECHNOLOGYUse Items to add dataprivate voidfrmCheckListBox_Load(object sender, EventArgs e) { chklbLeft.Items.Add(Tèo);chklbLeft.Items.Add(Tí);chklbLeft.Items.Add(Bin);chklbLeft.Items.Add(Bo); }Or we could use AddRange DONG NAI UNIVERSITY OF TECHNOLOGYHow to ...

Tài liệu được xem nhiều: