'--- dans l'UserForm ---
Option Explicit
Private WithEvents USF As Classe1
Private Sub UserForm_Activate()
Set USF = New Classe1
TextBox1.SetFocus
Me.Controls(Me.ActiveControl.Name). _
Object.BackColor = RGB(200, 200, 200)
USF.cibleFocus Me
End Sub
Private Sub USF_GetFocus()
Me.Controls(Me.ActiveControl.Name). _
Object.BackColor = RGB(200, 200, 200)
End Sub
Private Sub USF_LostFocus(ByVal Txtbx As String)
Me.Controls(Txtbx).BackColor = RGB(255, 255, 255)
End Sub
Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
Set USF = Nothing
End Sub