Vb.net – Position form at the bottom right corner of the screen in visual basic

vb.net

How can I position a form at the bottom right corner of the screen when the form loads? I'm using Visual Basic 2010 Express.

Thanks

EDIT: I did this and it seems to work great.

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)

Best Answer

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
Related Topic