Salut Blandine,
Grace à ce code placé dans le private module du User Form, tu obtiendras l'impossibilité de déplacement du User Form en question ainsi que l'impossibilité de le fermer avec la croix. (Attention prévoir un bouton de sortie...)
Ce code vient du MPFE, je pense Laurent Longre ou Frederic Sigonneau, et je l'utilise souvent quand je veux "canaliser" les users...
Private Declare Function FindWindowA Lib "User32" _
(ByVal lpClassName As String, ByVal lpWindowName As String) 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 Sub UserForm_Activate()
Dim hWnd As Long, exLong As Long
hWnd = FindWindowA(vbNullString, Me.Caption)
exLong = GetWindowLongA(hWnd, -16)
If exLong And &H880000 Then
SetWindowLongA hWnd, -16, exLong And &HFF77FFFF
Me.Hide: Me.Show
End If
End Sub
Bon travail,
@+Thierry