Sub testNonModal()
TOTOUSF.Show 0
End Sub
Sub testModal()
TOTOUSF.Show
End Sub
Sub test_avec_un_control_du_userform() 'le meme test est efectué au click sur le bouton dans le userform en modal
MsgBox UserFormShowMode(UserForm1.CommandButton1)
End Sub
Function UserFormShowMode(ByVal Obj As Object) As Integer
Dim errNum&, I&, previousOBJ As Object
'Init Return Value
Do While errNum = 0
On Error Resume Next
Set previousOBJ = Obj: Set Obj = Obj.Parent
errNum = Err.Number
Debug.Print "previous object " & previousOBJ.Name & " - object parent " & Obj.Name & " error : " & Err.Number
Err.Clear
Loop
MsgBox TypeOf previousOBJ Is UserForm
MsgBox TypeOf Obj Is UserForm
End Function