Private Sub placementUF(Obj As Object)
If Not Obj Is Nothing Then
Dim Lft As Double, Rgt As Double, top As Double, Bot As Double, P As Object, PInsWidth As Double, PInsHeight As Double
Dim K As Double, Zom As Double, Ombre As Double, EcX As Double, OpWin As Long
OpWin = Int(Val(Mid(Application.OperatingSystem, InStrRev(Application.OperatingSystem, " ") + 1))) 'number version system
If OpWin = 6 Or Int(Val(Application.Version)) < 16 Then EcX = 2: Ombre = 2 Else EcX = 0: Ombre = 0 'ecart cadre
Lft = Obj.Left: top = Obj.top: Set P = Obj.Parent ' Normalement Page, Frame ou UserForm
Do
PInsWidth = P.InsideWidth: PInsHeight = P.InsideHeight ' Le Page en est pourvu, mais pas le Multipage.
If TypeOf P Is MSForms.Page Then Set P = P.Parent ' Prend le Multipage, car le Page est sans positionnement.
K = (P.Width - PInsWidth) / 2: Lft = (Lft + P.Left + K): top = (top + P.top + P.Height - K - PInsHeight)
If Not (TypeOf P Is MSForms.Frame Or TypeOf P Is MSForms.MultiPage) Then Exit Do
Set P = P.Parent
Loop
Me.Left = Lft + EcX + Ombre + ((Obj.Width / 2) * Px) ' a gauche en top
Me.top = top + 2 + Ombre + ((Obj.Height / 2) * Py)
End If
End Sub