' Position the form in the lower right corner.
Private Sub PutFormInLowerRight(ByVal frm As Form, ByVal _
right_margin As Single, ByVal bottom_margin As Single)
Dim wa_info As RECT
If SystemParametersInfo(SPI_GETWORKAREA, _
0, wa_info, 0) <> 0 _
Then
' We got the information. Position the form.
' Position the form.
frm.Left = ScaleX(wa_info.Right, vbPixels, vbTwips) _
- _
Width - right_margin
frm.Top = ScaleY(wa_info.Bottom, vbPixels, vbTwips) _
- _
Height - bottom_margin
Else
' We did not get the work area bounds.
' Use the entire screen.
frm.Left = Screen.Width - Width - right_margin
frm.Top = Screen.Height - Height - bottom_margin
End If
End Sub
|