Share vb.net zorder

doanduy.manh

New member
#vb.net #Zorder #Zorder-vb.net #Zorder-in-vb.net #Zorder-perty-vb.net ** vb.net zorder **

Thuộc tính Zorder trong vb.net chỉ định thứ tự các điều khiển được vẽ trên một biểu mẫu.Các điều khiển có giá trị zorder cao hơn được vẽ trên đầu các điều khiển với giá trị zorder thấp hơn.

Bạn có thể sử dụng thuộc tính Zorder để kiểm soát thứ tự xếp chồng của các điều khiển trên một biểu mẫu.Ví dụ: bạn có thể sử dụng thuộc tính Zorder để làm cho một nút xuất hiện trên đầu hộp văn bản hoặc để làm một nhãn xuất hiện phía sau một hộp ảnh.

Để đặt thuộc tính Zorder của điều khiển, hãy sử dụng cú pháp sau:

`` `
điều khiển.zorder = giá trị
`` `

Trong đó `control` là tên của điều khiển và` value` là giá trị zorder mới.

Giá trị zorder có thể là bất kỳ số nguyên nào, nhưng nó thường là một số nguyên dương.Giá trị zorder mặc định là 0.

Bạn cũng có thể sử dụng phương thức Zorder để thay đổi giá trị zorder của điều khiển.Phương thức Zorder có một đối số duy nhất, đó là giá trị Zorder mới.

`` `
điều khiển.zorder (giá trị)
`` `

Mã sau đây cho thấy cách sử dụng thuộc tính Zorder để thay đổi thứ tự xếp chồng của hai điều khiển trên một biểu mẫu:

`` `
'Tạo hai nhãn.
Dim Label1 là nhãn mới
Dim Label2 dưới dạng nhãn mới

'Thêm nhãn vào biểu mẫu.
Me.controls.add (Label1)
Me.controls.add (Label2)

'Đặt các giá trị zorder của các nhãn.
Label1.Zorder = 0
Label2.Zorder = 1

'Hiển thị biểu mẫu.
Me.show ()
`` `

Khi biểu mẫu được hiển thị, nhãn có giá trị Zorder là 1 sẽ được vẽ trên đầu của nhãn với giá trị Zorder là 0.

## Người giới thiệu

* [Thuộc tính VB.NET Zorder] (https://docs.microsoft.com/en-us/dotnet/api/system.windows.form.control.zorder?view=net-6.0)
* [VB.NET Zorder Phương pháp] (https://docs.microsoft.com/en-us/dotnet/api/system.windows.form.control.zorder?view=net-6.0)
=======================================
#vb.net #Zorder #Zorder-vb.net #Zorder-in-vb.net #Zorder-property-vb.net **VB.NET ZORDER**

The ZORDER property in VB.NET specifies the order in which controls are drawn on a form. Controls with a higher ZORDER value are drawn on top of controls with a lower ZORDER value.

You can use the ZORDER property to control the stacking order of controls on a form. For example, you could use the ZORDER property to make a button appear on top of a textbox, or to make a label appear behind a picturebox.

To set the ZORDER property of a control, use the following syntax:

```
control.ZORDER = value
```

where `control` is the name of the control and `value` is the new ZORDER value.

The ZORDER value can be any integer, but it is usually a positive integer. The default ZORDER value is 0.

You can also use the ZORDER method to change the ZORDER value of a control. The ZORDER method takes a single argument, which is the new ZORDER value.

```
control.ZORDER(value)
```

The following code shows how to use the ZORDER property to change the stacking order of two controls on a form:

```
' Create two labels.
Dim label1 As New Label
Dim label2 As New Label

' Add the labels to the form.
Me.Controls.Add(label1)
Me.Controls.Add(label2)

' Set the ZORDER values of the labels.
label1.ZORDER = 0
label2.ZORDER = 1

' Display the form.
Me.Show()
```

When the form is displayed, the label with the ZORDER value of 1 will be drawn on top of the label with the ZORDER value of 0.

## References

* [VB.NET ZORDER Property](https://docs.microsoft.com/en-us/dotnet/api/system.windows.forms.control.zorder?view=net-6.0)
* [VB.NET ZORDER Method](https://docs.microsoft.com/en-us/dotnet/api/system.windows.forms.control.zorder?view=net-6.0)
 
Join Telegram ToolsKiemTrieuDoGroup
Back
Top