当表单加载时,如何在窗口的右下角放置表单?我正在使用Visual Basic 2010 Express.
谢谢
编辑:我做了这个,似乎工作得很好.
Dim x As Integer
Dim y As Integer
x = Screen.PrimaryScreen.WorkingArea.Width - 400
y = Screen.PrimaryScreen.WorkingArea.Height - 270
Me.Location = New Point(x, y)
Run Code Online (Sandbox Code Playgroud)
小智 8
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.Visible = True
Dim x As Integer
Dim y As Integer
x = Screen.PrimaryScreen.WorkingArea.Width
y = Screen.PrimaryScreen.WorkingArea.Height - Me.Height
Do Until x = Screen.PrimaryScreen.WorkingArea.Width - Me.Width
x = x - 1
Me.Location = New Point(x, y)
Loop
End Sub
Run Code Online (Sandbox Code Playgroud)
您需要将Form.StartPosition更改为Manual并更改窗体的Location属性
要么
使用Form.StartPosition属性和Form.Location属性
| 归档时间: |
|
| 查看次数: |
89436 次 |
| 最近记录: |