Share vb.net location x y

## vb.net Nhận vị trí x và y

[Liên kết đến bài viết tham khảo]

Trong VB.NET, bạn có thể nhận được vị trí X và Y của điều khiển bằng mã sau:

`` `
Dim x như số nguyên
Dim y như số nguyên

x = me.location.x
y = me.location.y
`` `

Thuộc tính `vị trí` của điều khiển trả về đối tượng` point`, có hai thuộc tính: `x` và` y`.Thuộc tính `X` đại diện cho vị trí ngang của điều khiển và thuộc tính` y` đại diện cho vị trí dọc của điều khiển.

Bạn cũng có thể sử dụng thuộc tính `screen.mousePocation` để có được vị trí của con trỏ chuột.Thuộc tính `screen.mousePocation` trả về đối tượng` point`, có cùng thuộc tính `x` và` y` như thuộc tính `vị trí` của điều khiển.

## hashtags

* #vb.net
* #X và y
* #Vị trí
* #điểm
* #MousePocation
=======================================
## VB.NET Get Location X and Y

[Link to reference article]

In VB.NET, you can get the location X and Y of a control using the following code:

```
Dim x As Integer
Dim y As Integer

x = Me.Location.X
y = Me.Location.Y
```

The `Location` property of a control returns a `Point` object, which has two properties: `X` and `Y`. The `X` property represents the horizontal position of the control, and the `Y` property represents the vertical position of the control.

You can also use the `Screen.MousePosition` property to get the location of the mouse cursor. The `Screen.MousePosition` property returns a `Point` object, which has the same `X` and `Y` properties as the `Location` property of a control.

## Hashtags

* #vb.net
* #X and Y
* #Location
* #point
* #MousePosition
 
Join Telegram ToolsKiemTrieuDoGroup
Back
Top