Private Sub Form_Load()
With Me
.Top = Screen.Height - .Height - 500
.Left = Screen.Width - .Width
End With
End Sub
BV писал(а):
- Код: Выделить всё
Private Sub Form_Load()
With Me
.Top = Screen.Height - .Height - 500
.Left = Screen.Width - .Width
End With
End Sub
Option Explicit
Private Declare Function SystemParametersInfo Lib "user32" Alias "SystemParametersInfoA" (ByVal uAction As Long, ByVal uParam As Long, ByVal lpvParam As Any, ByVal fuWinIni As Long) As Long
Private Const SPI_GETWORKAREA As Long = 48
Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Private Sub Form_Load()
Dim tRCT As RECT
SystemParametersInfo SPI_GETWORKAREA, ByVal 0&, VarPtr(tRCT), ByVal 0&
'left top
Me.Top = tRCT.Top * Screen.TwipsPerPixelY
Me.Left = tRCT.Left * Screen.TwipsPerPixelX
'left bottom
Me.Top = (tRCT.Bottom - tRCT.Top) * Screen.TwipsPerPixelY - Me.Height
Me.Left = tRCT.Left * Screen.TwipsPerPixelX
'right top
Me.Top = tRCT.Top * Screen.TwipsPerPixelY
Me.Left = (tRCT.Right - tRCT.Left) * Screen.TwipsPerPixelX - Me.Width
'right bottom
Me.Top = (tRCT.Bottom - tRCT.Top) * Screen.TwipsPerPixelY - Me.Height
Me.Left = (tRCT.Right - tRCT.Left) * Screen.TwipsPerPixelX - Me.Width
End Sub
Самое простое :AaA писал(а):Как программно расположить форму влевом верхнем углу, вправом верхнем углу, влевом нижнем углу и вправом нижнем углу.
Me.WindowState = vbMaximized
Сейчас этот форум просматривают: SemrushBot и гости: 58