Beginning Microsoft Visual C# 2008 PHẦN 10

Chạy ví dụ này và thử nghiệm với nội dung thay đổi kích thước. Lưu ý thêm lên thứ tự sắp xếp điều khiển, ưu tiên nhiều hơn cho không gian của nó. Bằng cách thu nhỏ cửa sổ, kiểm soát biên giới thứ năm có thể nhanh chóng được hoàn toàn che khuất bởi các điều khiển thêm lên thứ tự sắp xếp. | Chapter 34 Windows Presentation Foundation Run this example and experiment with resizing content. Note that the further up the stacking order a control is the more priority is given to its space. By shrinking the window the fifth Border control can quickly be completely obscured by controls further up the stacking order. Be careful when using DockPanel control layout to avoid this perhaps by setting minimum dimensions for the window. Grid Grid controls can have multiple rows and columns that you can use to lay out child controls. You have used Grid controls several times already in this chapter but in all cases you used a Grid with a single row and a single column. To add more rows and columns you must use the RowDefinitions and ColumnDefinitions properties which are collections of RowDefinition and ColumnDefinition objects respectively and are specified using property element syntax Grid RowDefinition RowDefinition ColumnDefinition ColumnDefinition . Grid This code defines a Grid control with three rows and two columns. Note that no extra information is required here with this code each row and column is dynamically resized automatically as the Grid control resizes. Each row will be a third of the height of the Grid and each column will be half the width. You can display lines between cells in a Grid by setting the property to true. You can control the resizing with Width Height MinWidth MaxWidth MinHeight and MaxHeight properties. For example setting the Width property of a column ensures that the column stays at that width. You can also set the Width property of a column to which means fill the remaining space after calculating the width of all other columns. This is actually the default. When you have multiple columns with a Width of then the remaining space is divided between them equally. The value can also be used with the Height property of rows. The .

Không thể tạo bản xem trước, hãy bấm tải xuống
TÀI LIỆU MỚI ĐĂNG
Đã 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.