Bai 3

Chia sẻ bởi T Son | Ngày 24/10/2018 | 40

Chia sẻ tài liệu: bai 3 thuộc Tin học 8

Nội dung tài liệu:

1
Layout
2
Fixed Layout
Position and Size:

this.button1.Location =
new System.Drawing.Point(176, 30);
this.button1.Size =
new System.Drawing.Size(75, 23);
3
Layout Properties
Form
Button
4
Padding
Là khoảng cách từ cạnh của controls đến nội dung của controls
Các controls cơ bản(Form,Button,…) và các controls thừa kế từ nó đều hỗ trợ thuộc tính này trừ các controls sau:TextBox, ListBox, ListView and MonthCalendar
5
Set Padding
runtime
design time
6
Margins
Khoảng cách giữa các controls trên cùng một Form hoặc Page
Thiết lập cho từng controls bằng thuộc tính Margin
Tất cả các controls đều hỗ trợ thuộc tình Margin ngoại trừ: Form
7
Example
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwue/html/ch14e.asp
8
Set Margins
runtime
design time
button1.Margin =
new System.Windows.Forms.Padding(10);
button1.Margin =
new System.Windows.Forms.Padding(10, 10, 10, 10);
9
Control Z-Order
Controls được hiện thị theo thứ tự từ ngoài vào trong
Control nằm ngoài cùng có z-order cao nhất.
Right-click lên control và sử dụng Bring To Front hoặc Send To Back để thay đổi thứ tự hiện thị
10
Dynamic Layout
Tất cả các controls được anchor mặc định là top, left
11
Anchor
Button 1 được anchor top, left, right
Button 2 được anchor top, left
button1.Anchor = ((System.Windows.Forms.AnchorStyles) (((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
12
Docking
13
Automatic Scaling
Control tự động thay đổi kích thước để chứa hết nội dung bên trong
Đặt thuộc tính AutoSize = True
14
Splitting
Dùng SplitContainer để thay đổi diện tích của các phần được tách riêng.
Set its Dock property to Fill
15
Flow Layout
FlowLayoutPanel Class: Là một Panel để chứa các controls bên trong theo thứ tự ngang hoặc dọc.
FlowLayoutPanel control
The FlowLayoutPanel control arranges its contents in a horizontal or vertical flow direction. Its contents can be wrapped from one row to the next, or from one column to the next. Alternatively, its contents can be clipped instead of wrapped (source: MSDN2)
16
FlowDirection & WrapContents Properties
17
Table Layout
FlowLayoutPanel Class: Là một Panel để chứa các controls bên trong theo một lưới gồm nhiều dòng, nhiều cột.
TableLayoutPanel control
The TableLayoutPanel control arranges its contents in a grid. Because the layout is performed both at design time and run time, it can change dynamically as the application environment changes. This gives the controls in the panel the ability to proportionally resize, so they can respond to changes such as the parent control resizing or text length changing due to localization (source: MSDN2)
18
Use TableLayoutPanel Control
* Một số tài liệu cũ có thể bị lỗi font khi hiển thị do dùng bộ mã không phải Unikey ...

Người chia sẻ: T Son
Dung lượng: | Lượt tài: 2
Loại file:
Nguồn : Chưa rõ
(Tài liệu chưa được thẩm định)