TAILIEUCHUNG - Illustrated WPF phần 9

Kiểm soát datepicker Việc kiểm soát datepicker cho phép người dùng nhập vào một ngày hoặc bằng cách gõ văn bản trong một hộp văn bản hoặc bằng cách sử dụng kiểm soát được xây dựng trong Lịch của datepicker. Giống như việc kiểm soát Lịch, kiểm soát datepicker được bao gồm trong WPF . Hình 16-16 cho thấy ảnh chụp màn hình của điều khiển datepicker. | CHAPTER 16 TREES TABS AND OTHER CONTROLS The DatePicker Control The DatePicker control allows the user to enter a date either by typing the text in a text box or by using the DatePicker s built-in Calendar control. Like the Calendar control the DatePicker control is included in WPF . Figure 16-16 shows screenshots of the DatePicker control. Figure 16-16. The DatePicker control allows the user two ways to enter a date. The following is the markup for the DatePicker control shown in Figure 16-16 StackPanel DatePicker Name datePicker HorizontalAlignment Left Width 110 TextBlock Text Selected Date FontWeight Bold Margin 5 5 5 2 TextBlock Margin 20 0 Text Binding ElementName datePicker Path SelectedDate StackPanel Most of DatePicker s important properties are for interacting with its built-in Calendar control and behave the same way. These properties include DisplayDateStart DisplayDateEnd BlackoutDates and SelectedDate. For example Figure 16-17 shows a DatePicker with the DisplayDateStart and DisplayDateEnd properties set. StackPanel DatePicker Name datePicker HorizontalAlignment Left Width 110 Margin 5 DisplayDateStart 5 10 2009 DisplayDateEnd 5 30 2009 7 TextBlock Text Selected Date FontWeight Bold Margin 5 5 5 2 TextBlock Margin 20 0 Text Binding ElementName datePicker Path SelectedDate StackPanel 1 DatePicker ZD 1 Show Calenda Selected Date May 2009 Su Mo Tu We Th Fr Sa ĨÕỊ 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 2 30 Figure 16-17. The DatePicker control uses many of the same properties as the Calendar control. 381 CHAPTER 16 TREES TABS AND OTHER CONTROLS The DataGrid Control The DataGrid control introduced in WPF displays a two-dimensional grid of data as shown in Figure 16-18. Although the screenshots in the figure show a very plain grid the DataGrid gives you extensive control over many aspects of its appearance. Figure 16-18. By default the user can sort a DataGrid on any column. The DataGrid is a powerful control with a large number of .

TỪ KHÓA LIÊN QUAN
TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.