Option Explicit
Dim Mouse As Boolean Private Sub Form_Load() Mouse = False End Sub Private Sub Text1_GotFocus() If Mouse = True Then Call MsgBox("Hai cliccato con il mouse") Else Call MsgBox("Hai premuto tab") End If Mouse = False End Sub Private Sub Text1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) Mouse = True End Sub '---------------------------------------------------------------- Sapere se un controllo ha ricevuto il focus In Form metti una textbox ed un altro controllo (es.CommandButton): |