CÁC ĐI U KHI N C B N Ề Ể Ơ Ả CÁC ĐI U KHI N C B N Ề Ể Ơ Ả TRONGC#TRONGC# ListView ListView 1. Ch c năngứ : Hi n th các m c d li u d i d ng danh ể ị ụ ữ ệ ướ ạ sách 2. M t s thu c tính th ng dùngộ ố ộ ườ Columns: Qu n lý (thêm/b t) các c t c a listview ả ớ ộ ủ Items: Là m t t p h p qu n lý toàn b các m c trong ộ ậ ợ ả ộ ụ danh sách GridLines: Xu t hi n l i gi a các hàng và c tấ ệ ướ ữ ộ FullRowSelect: MultiSelect: CheckBoxes: Xu t hi n checkbxox tr c m i hàng ấ ệ ướ ỗ (V trí đ u tiên c a m i hàng)ị ầ ủ ỗ LabelEdit: SelectedItems: Qu n lý các m c đang đ c ch n ả ụ ượ ọ CheckedItems: Tr v danh sách các ph n t đ c ả ề ầ ử ượ check ……………………………………………… 3. S ki nự ệ SelectedIndexChanged: Khi ng i s d ng thay ườ ử ụ đ i ph n t ch n trong Lổ ầ ử ọ istview ItemChecked: Khi Check vào bi u t ng ể ượ Checkbox c a m i ph n t trên đi u khi n ủ ỗ ầ ử ề ể ListView ItemSelectionChanged ……………………………………. ListView (ti p)ế ListView (ti p)ế M t s khái ni m liên quan đ n ộ ố ệ ế M t s khái ni m liên quan đ n ộ ố ệ ế ListView ListView M t s khái ni m liên quan đ n ộ ố ệ ế M t s khái ni m liên quan đ n ộ ố ệ ế ListView ListView C t - Columnsộ M t s khái ni m liên quan đ n ộ ố ệ ế M t s khái ni m liên quan đ n ộ ố ệ ế ListView ListView Text M t s khái ni m liên quan đ n ộ ố ệ ế M t s khái ni m liên quan đ n ộ ố ệ ế ListView ListView 1 ListViewItem 1 Hàng = 1 ListViewItem M t s khái ni m liên quan đ n ộ ố ệ ế M t s khái ni m liên quan đ n ộ ố ệ ế ListView ListView Subitems[0] Subitems[1] → 1 ô = 1 Subitems Minh h a ListViewọ Minh h a ListViewọ Gi s có m t ListView có tên là LV (View=Detail)ả ử ộ B c 1ướ : Ch a làm gìư B c 2ướ : Thêm c t vào LVộ LV.Columns.Add(“Name“); //Ho cặ ColumnHeader ch = new ColumnHeader("clName"); ch.Text = "Name"; LV.Columns.Add(ch); Name Minh h a ListViewọ Minh h a ListViewọ B c 3ướ : Thêm c t th 2 vào LVộ ứ LV.Columns.Add(“Size“); //Ho cặ ColumnHeader ch = new ColumnHeader("clSize"); ch.Text = “Size"; LV.Columns.Add(ch); Name Size B c 4ướ : T o hàng m i (ch a ạ ớ ư có giá tr )ị ListViewItem lvi = new ListViewItem(); . m liên quan đ n ộ ố ệ ế ListView ListView 1 ListViewItem 1 Hàng = 1 ListViewItem M t s khái ni m liên quan đ n ộ ố ệ ế M t s khái ni m liên quan đ n ộ ố ệ ế ListView ListView Subitems[0] Subitems[1]. ỗ ầ ử ề ể ListView ItemSelectionChanged ……………………………………. ListView (ti p)ế ListView (ti p)ế M t s khái ni m liên quan đ n ộ ố ệ ế M t s khái ni m liên quan đ n ộ ố ệ ế ListView ListView . t s khái ni m liên quan đ n ộ ố ệ ế ListView ListView C t - Columnsộ M t s khái ni m liên quan đ n ộ ố ệ ế M t s khái ni m liên quan đ n ộ ố ệ ế ListView ListView Text M t s khái ni m liên