Private Sub UserForm_Initialize() Me.Width = Application.Width Me.Height = Application.Height Image1.Width = Me.Width Image1.Height = Me.Height End Sub
Serge
"Fring" a écrit dans le message de news:
Bonjour !
Comment placer une image plein écran dans un USF ?
Ci-joint mon fichier exemple.
Merci,
§Fring
http://cjoint.com/?eDstZ5kJNo
PMO
Bonjour,
Une piste avec votre code modifié ci-dessous
'********************* 'Déclarations API Windows
Private Declare Function GetDC& Lib "User32" _ (ByVal hWnd As Long) Private Declare Function ReleaseDC& Lib "User32" _ (ByVal hWnd As Long, ByVal hdc As Long) Private Declare Function GetDeviceCaps& Lib "Gdi32" _ (ByVal hdc As Long, ByVal nIndex As Long)
Private Declare Function GetWindowLongA Lib "User32" _ (ByVal hWnd As Long, ByVal nIndex As Long) As Long Private Declare Function SetWindowLongA Lib "User32" _ (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long Private Declare Function FindWindowA Lib "User32" _ (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Sub BoutSortir_Click() If BoutSortir.Enabled = True Then Select Case MsgBox("Bonne continuation, à bientôt !" & _ vbCrLf & "", vbYesNo Or vbInformation _ Or vbDefaultButton1, Application.Name) Case vbYes Unload Me Case vbNo MsgBox ("C'est repartit pour un tour ?!!!") Exit Sub End Select End If End Sub
Private Sub CommandButton3_Click() 'Unload UsFStart End Sub
Private Sub CommandButton4_Click() Unload Me End Sub
Private Sub UserForm_Initialize() Dim hWnd As Long hWnd = FindWindowA("Thunder" & _ IIf(Application.Version Like "8*", "X", "D") & _ "Frame", Me.Caption) SetWindowLongA hWnd, -16, GetWindowLongA(hWnd, -16) _ And &HFFF7FFFF End Sub
Private Sub UserForm_Activate() Dim Context& 'résolution d'écran Application.StatusBar = _ "Programme en cours d'exécution ..." Context& = GetDC(0) With Me .PictureAlignment = fmPictureAlignmentTopLeft .PictureSizeMode = fmPictureSizeModeStretch .Width = GetDeviceCaps(Context&, 8) .Height = GetDeviceCaps(Context&, 10) .Left = 0 .Top = 0 End With ReleaseDC 0, Context& End Sub '*********************
Cordialement.
PMO Patrick Morange
Bonjour,
Une piste avec votre code modifié ci-dessous
'*********************
'Déclarations API Windows
Private Declare Function GetDC& Lib "User32" _
(ByVal hWnd As Long)
Private Declare Function ReleaseDC& Lib "User32" _
(ByVal hWnd As Long, ByVal hdc As Long)
Private Declare Function GetDeviceCaps& Lib "Gdi32" _
(ByVal hdc As Long, ByVal nIndex As Long)
Private Declare Function GetWindowLongA Lib "User32" _
(ByVal hWnd As Long, ByVal nIndex As Long) As Long
Private Declare Function SetWindowLongA Lib "User32" _
(ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Private Declare Function FindWindowA Lib "User32" _
(ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Sub BoutSortir_Click()
If BoutSortir.Enabled = True Then
Select Case MsgBox("Bonne continuation, à bientôt !" & _
vbCrLf & "", vbYesNo Or vbInformation _
Or vbDefaultButton1, Application.Name)
Case vbYes
Unload Me
Case vbNo
MsgBox ("C'est repartit pour un tour ?!!!")
Exit Sub
End Select
End If
End Sub
Private Sub CommandButton3_Click()
'Unload UsFStart
End Sub
Private Sub CommandButton4_Click()
Unload Me
End Sub
Private Sub UserForm_Initialize()
Dim hWnd As Long
hWnd = FindWindowA("Thunder" & _
IIf(Application.Version Like "8*", "X", "D") & _
"Frame", Me.Caption)
SetWindowLongA hWnd, -16, GetWindowLongA(hWnd, -16) _
And &HFFF7FFFF
End Sub
Private Sub UserForm_Activate()
Dim Context& 'résolution d'écran
Application.StatusBar = _
"Programme en cours d'exécution ..."
Context& = GetDC(0)
With Me
.PictureAlignment = fmPictureAlignmentTopLeft
.PictureSizeMode = fmPictureSizeModeStretch
.Width = GetDeviceCaps(Context&, 8)
.Height = GetDeviceCaps(Context&, 10)
.Left = 0
.Top = 0
End With
ReleaseDC 0, Context&
End Sub
'*********************
Private Declare Function GetDC& Lib "User32" _ (ByVal hWnd As Long) Private Declare Function ReleaseDC& Lib "User32" _ (ByVal hWnd As Long, ByVal hdc As Long) Private Declare Function GetDeviceCaps& Lib "Gdi32" _ (ByVal hdc As Long, ByVal nIndex As Long)
Private Declare Function GetWindowLongA Lib "User32" _ (ByVal hWnd As Long, ByVal nIndex As Long) As Long Private Declare Function SetWindowLongA Lib "User32" _ (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long Private Declare Function FindWindowA Lib "User32" _ (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Sub BoutSortir_Click() If BoutSortir.Enabled = True Then Select Case MsgBox("Bonne continuation, à bientôt !" & _ vbCrLf & "", vbYesNo Or vbInformation _ Or vbDefaultButton1, Application.Name) Case vbYes Unload Me Case vbNo MsgBox ("C'est repartit pour un tour ?!!!") Exit Sub End Select End If End Sub
Private Sub CommandButton3_Click() 'Unload UsFStart End Sub
Private Sub CommandButton4_Click() Unload Me End Sub
Private Sub UserForm_Initialize() Dim hWnd As Long hWnd = FindWindowA("Thunder" & _ IIf(Application.Version Like "8*", "X", "D") & _ "Frame", Me.Caption) SetWindowLongA hWnd, -16, GetWindowLongA(hWnd, -16) _ And &HFFF7FFFF End Sub
Private Sub UserForm_Activate() Dim Context& 'résolution d'écran Application.StatusBar = _ "Programme en cours d'exécution ..." Context& = GetDC(0) With Me .PictureAlignment = fmPictureAlignmentTopLeft .PictureSizeMode = fmPictureSizeModeStretch .Width = GetDeviceCaps(Context&, 8) .Height = GetDeviceCaps(Context&, 10) .Left = 0 .Top = 0 End With ReleaseDC 0, Context& End Sub '*********************