1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
|
Private Declare Function SetWindowPos _
Lib "user32" ( _
ByVal Hwnd As Long, _
ByVal hWndInsertAfter As Long, _
ByVal x As Long, _
ByVal y As Long, _
ByVal cx As Long, _
ByVal cy As Long, _
ByVal wFlags As Long) As Long
Private Declare Function FindWindowA _
Lib "user32" ( _
ByVal lpClassName As String, _
ByVal lpWindowName As String) As Long
Private Sub UserForm_Initialize()
Dim Position As Long
Dim Hwnd As Long
Dim Hauteur As Long
Dim Largeur As Long
With Me
Hauteur = .Height
Largeur = .Width
Hwnd = FindWindowA(vbNullString, .Caption)
Position = SetWindowPos(Hwnd, -1, _
.Top, _
.Left, _
.Width, _
.Height, 0)
.Width = Largeur
.Height = Hauteur
End With
End Sub |
Partager